比赛 20121121 评测结果 WWWAWWAWWA
题目名称 谁拿了最多奖学金 最终得分 30
用户昵称 Satoshi 运行时间 0.005 s
代码语言 C++ 内存使用 3.15 MiB
提交时间 2012-11-21 20:40:35
显示代码纯文本
#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];
	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(endmark[i]>80&&ganbu[i]=='Y')sum[i]=sum[i]+850;
	}
	for(i=1;i<=n;i++)s=s+sum[i];
	for(i=1;i<=n;i++)if(sum[i]>t)t=sum[i];
	for(i=1;i<=n;i++)if(sum[i]==t)
	{
		out<<name[i]<<endl;break;
	}
	out<<t<<endl;
	out<<s;
	in.close();
	out.close();
	return 0;
}