- 题解
- 2013-03-21 21:18:26 @
#include <stdio.h>
#include<string.h>
int main()
{
int qimo,banji,score,ilw,grade[100],max;
int num,i,cnt=0;
char name[21],cgb,cwe,gname[100][21];
int total=0;
do{
scanf("%d",&num);
}while(num<1&&num>100);
for(i=0;i<num;i++)
{
scanf("%s %d %d %c %c %d",name,&qimo,&banji,&cgb,&cwe,&ilw);
score=0;
if(qimo>80&&ilw>=1)
score+=8000;
if(qimo>85&&banji>80)
score+=4000;
if(qimo>90)
score+=2000;
if(qimo>80&&(cwe=='Y'||cwe=='y'))
score+=1000;
if(banji>80&&(cgb=='Y'||cgb=='y'))
score+=850;
grade[i]=score;
strcpy(gname[i],name);
total+=score;
}
max=grade[0];
for(i=0;i<num;i++)
{
if(grade[i]>max)
{
max=grade[i];
cnt=i;
}
}
printf("%s\n",gname[cnt]);
printf("%d\n",max);
printf("%d\n",total);
return 0;
}
4 条评论
-
数据弱爆了 LV 6 @ 2013-03-25 07:40:27
找个标程对拍一下不就好了
-
2013-03-25 01:10:33@
请自行debug
-
2013-03-24 18:24:59@
难道你们写的代码都带着注释吗,以后我会注意的。
-
2013-03-24 15:58:38@
没有注释的代码不好看啊
- 1