记录编号 552714 评测结果 AAAAAAAAAA
题目名称 [NOIP 2005]谁拿了最多奖学金 最终得分 100
用户昵称 Gravatar城南花已开 是否通过 通过
代码语言 C++ 运行时间 0.009 s
提交时间 2020-08-03 23:18:06 内存使用 13.66 MiB
显示代码纯文本
# include <iostream>
# include <cstdio>
# include <cstring>
using namespace std;
struct student{
	string name;
	char cadre,west;
	int finalgrades,classgrades,paper,total;
};
student a[101];
int n,max1=-1,max2,sum=0;
int main(){
	freopen("scholar.in","r",stdin);
	freopen("scholar.out","w",stdout);
	cin >>n;
	for(int i=0;i<101;i++){
		a[i].total=0;
	}
	for(int i=1;i<=n;i++){
		cin>>a[i].name>>a[i].finalgrades>>a[i].classgrades>>a[i].cadre>>a[i].west>>a[i].paper;
		if(a[i].finalgrades>80&&a[i].paper>=1){
			a[i].total+=8000;
		}
		if(a[i].finalgrades>85&&a[i].classgrades>80){
			a[i].total+=4000;
		}
		if(a[i].finalgrades>90){
			a[i].total+=2000;
		}
		if(a[i].west=='Y'&&a[i].finalgrades>85){
			a[i].total+=1000;
		}
		if(a[i].classgrades>80&&a[i].cadre=='Y'){
			a[i].total+=850;
		}
	}
	for(int i=1;i<=n;i++){
		sum+=a[i].total;
		if(a[i].total>max1){
			max1=a[i].total;
			max2=i;
		}
	}
	cout <<a[max2].name<<endl<<max1<<endl<<sum<<endl;
	fclose(stdin);
	fclose(stdout);
	return 0;
}