比赛 |
NOIP2015普及组练习 |
评测结果 |
AAAAAAAAAA |
题目名称 |
谁拿了最多奖学金 |
最终得分 |
100 |
用户昵称 |
lingyixiaoyao |
运行时间 |
0.015 s |
代码语言 |
C++ |
内存使用 |
0.32 MiB |
提交时间 |
2015-11-04 13:05:13 |
显示代码纯文本
#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
struct student
{
string name;
int score,classscore,passage,money;
char cadre,weststudent;
}S[105];
bool compare(student a,student b){return a.money<b.money;}
int main()
{
freopen("scholar.in","r",stdin);
freopen("scholar.out","w",stdout);
int n,ans=0;
scanf("%d",&n);
for(int i=0;i<n;i++) cin>>S[i].name>>S[i].score>>S[i].classscore>>S[i].cadre>>S[i].weststudent>>S[i].passage;
for(int i=0;i<n;i++)
{
S[i].money=0;
if(S[i].score>80&&S[i].passage>0) S[i].money+=8000;
if(S[i].score>85&&S[i].classscore>80) S[i].money+=4000;
if(S[i].score>90) S[i].money+=2000;
if(S[i].score>85&&S[i].weststudent=='Y') S[i].money+=1000;
if(S[i].classscore>80&&S[i].cadre=='Y') S[i].money+=850;
ans+=S[i].money;
}
student t=*max_element(S,S+n,compare);
cout<<t.name<<endl<<t.money<<endl<<ans;
return 0;
}