观摩学习

#include <stdio.h>
#include <string.h>

int main(){
int n;
char name[30];
int grade1;
int grade2;
char cadres;
char west;
int number;
int i;
int amount;
int max;
int sum;
char temp[30];

while(~scanf("%d",&n))
{

sum=0;
for(i=0;i<n;i++){
scanf("%s%d%d %c %c%d",&name,&grade1,&grade2,&cadres,&west,&number);

amount=0;

if(grade1>80 && number>=1)
amount+=8000;

if(grade1>85 && grade2>80)
amount+=4000;

if(grade1>90)
amount+=2000;

if(grade1>85 && west=='Y')
amount+=1000;

if(grade2>80 && cadres=='Y')
amount+=850;

sum+=amount;

if(i==0){
max=amount;
strcpy(temp,name);
continue;
}

if(amount>max){
max=amount;
strcpy(temp,name);
}
}

printf("%s\n%d\n%d\n",temp,max,sum);
}

return 0;
}

0 条评论

目前还没有评论...

信息

ID
1001
难度
5
分类
模拟 点击显示
标签
递交数
28014
已通过
9649
通过率
34%
上传者