记录编号 |
50622 |
评测结果 |
AAAAAAAAAA |
题目名称 |
[NOIP 2005]谁拿了最多奖学金 |
最终得分 |
100 |
用户昵称 |
Satoshi |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
0.005 s |
提交时间 |
2012-11-26 20:48:39 |
内存使用 |
3.15 MiB |
显示代码纯文本
#include <fstream>
#include <string>
using namespace std;
int main()
{
int n,i,endmark[101],classmark[101],article[101],sum[101]={0},s=0,t=0;
string name[101],name2;
char ganbu[101],west[101];
ifstream in("scholar.in");
ofstream out("scholar.out");
in>>n;
for(i=1;i<=n;i++)
{
in>>name[i];
in>>endmark[i];
in>>classmark[i];
in>>ganbu[i];
in>>west[i];
in>>article[i];
}
for(i=1;i<=n;i++)
{
if(endmark[i]>80&&article[i]>=1)sum[i]=sum[i]+8000;
if(endmark[i]>85&&classmark[i]>80)sum[i]=sum[i]+4000;
if(endmark[i]>90)sum[i]=sum[i]+2000;
if(endmark[i]>85&&west[i]=='Y')sum[i]=sum[i]+1000;
if(classmark[i]>80&&ganbu[i]=='Y')sum[i]=sum[i]+850;
s=s+sum[i];
}
for(i=1;i<=n;i++)if(sum[i]>t){t=sum[i];name2=name[i];}
out<<name2<<endl;
out<<t<<endl;
out<<s<<endl;
in.close();
out.close();
return 0;
}