解题思路:
注意事项:
参考代码:
#include <stdio.h>
#include <stdlib.h>
struct student
{
char name[20];
int score1,score2;
char ganbu,west;
char chair;
int date;
int schoolship;
}a[200];
int main()
{
int n;
while(scanf("%d",&n)!=EOF)
{
int i;
for(i=1;i<=n;i++)
{
scanf("%s %d %d %c %c %d",a[i].name,&a[i].score1,&a[i].score2,&a[i].chair,&a[i].west,&a[i].date);
if(a[i].score1>80&&a[i].date>0) a[i].schoolship+=8000;
if(a[i].score1>85&&a[i].score2>80) a[i].schoolship+=4000;
if(a[i].score1>90) a[i].schoolship+=2000;
if(a[i].score1>85&&a[i].west=='Y') a[i].schoolship+=1000;
if(a[i].score2>80&&a[i].chair=='Y') a[i].schoolship+=850;
}
int max=1,sum=0;
for(i=1;i<=n;i++)
{
if(a[i].schoolship>a[max].schoolship)
max=i;
sum+=a[i].schoolship;
}
printf("%s\n%d\n%d\n",a[max].name,a[max].schoolship,sum);
}
return 0;
}
0.0分
4 人评分
C语言程序设计教程(第三版)课后习题5.6 (C语言代码)浏览:563 |
P1001 (C语言代码)浏览:836 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:591 |
2004年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:539 |
IP判断 (C语言代码)浏览:819 |
C语言程序设计教程(第三版)课后习题8.8 (C语言代码)浏览:583 |
C语言程序设计教程(第三版)课后习题10.3 (C语言代码)浏览:523 |
The 3n + 1 problem (C语言代码)浏览:550 |
C语言训练-自守数问题 (C语言代码)浏览:798 |
1052题解(链表操作)浏览:782 |