- 谁拿了最多奖学金
- 2016-04-28 01:54:36 @
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main(){
int n;
cin>>n;
char name[n][21];
int sco1[n],sco2[n],pap[n],sch[n];
char lead[n],wes[n];
memset(sch,0,sizeof(sch));
for (int i = 0; i < n; ++i)
{
scanf("%s",&name[i]);
cin>>sco1[i]>>sco2[i]>>lead[i]>>wes[i]>>pap[i];
}
for (int i = 0; i < n; ++i)
{
if(sco1[i]>80&&pap[i]>=1)sch[i]+=8000;
if(sco1[i]>85&&sco2[i]>80)sch[i]+=4000;
if(sco1[i]>90)sch[i]+=2000;
if(sco1[i]>85&&wes[i]=='Y')sch[i]+=1000;
if(sco1[i]>80&&lead[i]=='Y')sch[i]+=850;
}
int flag,max=0;
for (int i = 0; i <n; i++)
{
if(sch[i]>max){
max=sch[i];
flag=i;
}
}
int sum=0;
for (int i = 0; i < n; ++i)
{
sum+=sch[i];
}
printf("%s\n",name[flag]);
cout<<max<<"\n"<<sum;
return 0;
}// input code here
2 条评论
-
stealthassassin LV 9 @ 2016-05-29 10:36:11
最后一项班级贡献奖的条件是班级评议成绩,也就是你的soc2[i]>80,你写成sco1[i]>80
-
2016-05-29 10:35:56@
最后一项班级贡献奖的条件是班级评议成绩,也就是你的soc2[i]>80,你写成sco1[i]>80
- 1