- 谁拿了最多奖学金
- 2016-08-23 15:42:54 @
// input code here
#include<bits/stdc++.h>
using namespace std;
struct Student
{
char c,d,Name[100];
int a,b,e,f=0;
}Students[101],Best;
int main()
{
int n,Temp=0;
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>Students[i].Name;
cin>>Students[i].a;
cin>>Students[i].b;
cin>>Students[i].c;
cin>>Students[i].d;
cin>>Students[i].e;
if((Students[i].a>80)&&(Students[i].e)) Students[i].f+=8000;
if((Students[i].a>85)&&(Students[i].b>80)) Students[i].f+=4000;
if(Students[i].a>90) Students[i].f+=2000;
if((Students[i].a>85)&&(Students[i].d=='Y')) Students[i].f+=1000;
if((Students[i].b>80)&&(Students[i].c=='Y')) Students[i].f+=850;
}
Best.f=0;
for(int i=1;i<=n;i++)
{
if(Students[i].f>Best.f)
{
strcpy(Best.Name,Students[i].Name);
Best.f=Students[i].f;
}
Temp+=Students[i].f;
}
cout<<Best.Name<<endl<<Best.f<<endl<<Temp<<endl;
}
1 条评论
-
贱人在我右边 LV 9 @ 2016-12-17 13:28:33
坑爹
- 1