3
30
2015
0

Tyvj 1002 谁拿了最多奖学金

#include <iostream>
#include <cstdio>
using namespace std;
string name,king;
int n,avrg,grde,papr;
char ofcl,west;
long long tot,best,t;
int main()
{
	cin>>n;
	for (int i=0;i<n;++i) {
		t=0;
		cin>>name>>avrg>>grde;
		getchar(); ofcl=getchar();
		getchar(); west=getchar(); getchar();
		cin>>papr;
		if (avrg>80 && papr>0) t+=8000;
		if (avrg>85 && grde>80) t+=4000;
		if (avrg>90) t+=2000;
		if (avrg>85 && west=='Y') t+=1000;
		if (grde>80 && ofcl=='Y') t+=850;
		if (t>best) {
			best=t; king=name;
		}
		tot+=t;
	}
	cout<<king<<endl<<best<<endl<<tot;
	return 0;
}
Category: 题解 | Tags: Tyvj 模拟 | Read Count: 180

登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter

Host by is-Programmer.com | Power by Chito 1.3.3 beta | Theme: Aeros 2.0 by TheBuckmaker.com