- 谁拿了最多奖学金
- 2016-07-21 13:35:09 @
#include<stdio.h>
#include<string.h>
#include<iostream>
using namespace std;
long long n,total=0;
int q;
struct
{
char s[21];
int fen,Class,ganbu,xibu,lunwen;
long monny;
}xyz[5];
void putin()
{
int i;
scanf("%lld",&n);
for(i=1;i<=n;i++){
char a1,b1;
scanf("%s %d %d %c %c %d",&xyz[i].s,&xyz[i].fen,&xyz[i].Class,&a1,&b1,&xyz[i].lunwen);
if(a1=='Y')
xyz[i].ganbu=1;
else
xyz[i].ganbu=0;
if(b1=='Y')
xyz[i].xibu=1;
else
xyz[i].xibu=0;
}
}
void work()
{
int i;
for(i=1;i<=n;i++)
xyz[i].monny=0;
for(i=1;i<=n;i++){
if(xyz[i].fen>80 && xyz[i].lunwen>=1)
xyz[i].monny+=8000;
if(xyz[i].fen>85 && xyz[i].Class>80)
xyz[i].monny+=4000;
if(xyz[i].fen>90)
xyz[i].monny+=2000;
if(xyz[i].fen>85 && xyz[i].xibu==1)
xyz[i].monny+=1000;
if(xyz[i].Class>80 && xyz[i].ganbu==1)
xyz[i].monny+=850;
total+=xyz[i].monny;
}
}
void work2()
{
long Max=0;
int i;
for(i=1;i<=n;i++)
if(xyz[i].monny>Max){
q=i;
Max=xyz[i].monny;
}
}
void putout()
{
printf("%s\n",&xyz[q].s);
cout<<xyz[q].monny<<"\n";
cout<<total;
}
int main()
{
putin();
work();
work2();
putout();
return 0;
}