显示代码纯文本
#include<fstream>
#include<string>
using namespace std;
int main(){
ifstream fin("scholar.in");
ofstream fout("scholar.out");
int total=0,i,n,s,max=0;
string a,b;
int qimo;
int banji;
char ganbu;
char xibu;
int lw;
fin>>n;
for(i=0;i<=n-1;i++){
fin>>a>>qimo>>banji>>ganbu>>xibu>>lw;
if(qimo>80&&lw>=1){
s=s+8000;}
if(qimo>85&&banji>80){
s=s+4000;}
if(qimo>90){
s=s+2000;}
if(qimo>85&&xibu=='Y'){
s=s+1000;}
if(banji>80&&ganbu=='Y'){
s=s+850;}
total=total+s;
if(s>max){
max=s;b=a;}s=0;}
fout<<b<<endl<<max<<endl<<total;
fin.close();
fout.close();
return 0;
}