比赛 |
NOIP2015普及组练习 |
评测结果 |
C |
题目名称 |
谁拿了最多奖学金 |
最终得分 |
0 |
用户昵称 |
88 |
运行时间 |
0.000 s |
代码语言 |
C++ |
内存使用 |
0.00 MiB |
提交时间 |
2015-11-05 21:35:22 |
显示代码纯文本
#include <string>
#include <iostream>
using namespace std;
string stu_name[100];
int stu_num[100];
int main()
{
freopen("scholar.in","r","stdin");
freopen("scholar.out","w","stdout";
int n;
cin>>n;
memset(stu_name,0,sizeof stu_name);
memset(stu_num,0,sizeof stu_num);
for(int i=0;i<n;i++)
{
int sc1,sc2;
char fl1,fl2;
int c;
cin>>stu_name[i];
cin>>sc1>>sc2>>fl1>>fl2>>c;
if(sc1>80&&c)
stu_num[i]+=8000;
if(sc1>85&&sc2>80)
stu_num[i]+=4000;
if(sc1>90)
stu_num[i]+=2000;
if(sc1>85&&fl2=='Y')
stu_num[i]+=1000;
if(sc2>80&&fl1=='Y')
stu_num[i]+=850;
}
int max_index=0;
int max_num=0;
for(int i=0;i<n;i++)
{
if(stu_num[i]>stu_num[max_index])
max_index=i;
max_num+=stu_num[i];
}
cout<<stu_name[max_index]<<endl<<stu_num[max_index]<<endl<<max_num<<endl;
return 0;
}