- 谁拿了最多奖学金
- 2021-01-19 09:05:58 @
#include <stdio.h>
#include <stdlib.h>
struct money{
char name[20];
int ave,disc;
char np;
char poor;
int essay;
int sum;
}mp[1000];
int main()
{
int n,i,sum;
scanf("%d",&n);
//struct money mp[n];
for(i=0;i<n;i++){
scanf("%s %d %d %c %c %d",mp[i].name,&mp[i].ave,&mp[i].disc,&mp[i].np,&mp[i].poor,&mp[i].essay);
mp[i].sum=0;
if(mp[i].ave>80&&mp[i].essay>0)sum+=8000;
if(mp[i].ave>85&&mp[i].disc>80)sum+=4000;
if(mp[i].ave>90)sum+=2000;
if(mp[i].ave>85&&mp[i].poor=='Y')sum+=1000;
if(mp[i].disc>80)sum+=850;
}
int t,large=mp[0].sum,sumplus=0;
for(i=1;i<n;i++)if(large<mp[i].sum)large=mp[i].sum,t=i;
for(i=0;i<n;i++)sumplus+=mp[i].sum;
printf("%s\n%d\n%d",mp[t].name,mp[0].sum,sumplus);
return 0;
}