- 谁拿了最多奖学金
- 2017-07-14 16:42:11 @
#include<bits/stdc++.h>
#define N 1005
using namespace std;
int n;
int all=0;
struct node{
int poi,eti,pap,mon;
bool wes,cad;
string name;
}stu[N];
bool cmp(const node &a,const node &b){
return a.mon>b.mon;
}
int main(){
scanf("%d",&n);
for(int i=1;i<=n;++i){
cin>>stu[i].name;
scanf("%d%d",&stu[i].poi,&stu[i].eti);
stu[i].mon=0;
char pd;
cin>>pd;
if(pd=='N') stu[i].cad=false;
else stu[i].cad=true;
cin>>pd;
if(pd=='Y') stu[i].wes=true;
else stu[i].wes=false;
scanf("%d",&stu[i].pap);
}
for(int i=1;i<=n;++i){
if(stu[i].poi>80&&stu[i].pap>=1){
stu[i].mon+=8000;
all+=8000;
}
if(stu[i].poi>85&&stu[i].eti>80){
stu[i].mon+=4000;
all+=4000;
}
if(stu[i].poi>90){
stu[i].mon+=2000;
all+=2000;
}
if(stu[i].poi>85&&(stu[i].wes==1)){
stu[i].mon+=1000;
all+=1000;
}
if(stu[i].eti>80&&(stu[i].cad==1)){
stu[i].mon+=850;
all+=850;
}
}
sort(stu+1,stu+n+1,cmp);
cout<<stu[1].name<<"\n";
printf("%d\n",stu[1].mon);
printf("%d",all);
return 0;
}