解题思路:
注意事项:
参考代码:
#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语言训练-立方和不等式 (C语言代码)浏览:775 |
【亲和数】 (C语言代码)浏览:525 |
数组输出 (C语言代码)错误???浏览:596 |
C语言程序设计教程(第三版)课后习题8.3 (C语言代码)浏览:786 |
C语言考试练习题_排列 (C语言代码)浏览:756 |
WU-输出九九乘法表 (C++代码)浏览:1839 |
剪刀石头布 (C语言代码)浏览:791 |
IP判断 (C语言代码)浏览:816 |
完数 (C语言代码)浏览:741 |
C语言程序设计教程(第三版)课后习题9.2 (C语言代码)浏览:568 |