显示代码纯文本
#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
#include<cstdio>
using namespace std;
typedef struct
{
string name;
int Avs;
int Cls;
char sof;
char wes;
int textn;
}human;
int main()
{
freopen("scholar.in", "r", stdin);
freopen("scholar.out", "w", stdout);
int n;
cin>>n;
human m[101];
int money[101];
int tot = 0;
memset(money, 0, sizeof(money));
for(int i = 0; i < n; ++i)
{
cin>>m[i].name>>m[i].Avs>>m[i].Cls>>m[i].sof>>m[i].wes>>m[i].textn;
if( m[i].Avs > 80 && m[i].textn >= 1 ) money[i] += 8000;
if( m[i].Cls > 80 && m[i].Avs >85 ) money[i] +=4000;
if( m[i].Avs > 90) money[i] += 2000;
if( m[i].Avs > 85 && m[i].wes == 'Y') money[i] +=1000;
if( m[i].Cls > 80 && m[i].sof == 'Y') money[i] +=850;
tot += money[i];
}
int max1 = *max_element(money, money + n);
int maxst = max_element(money, money + n) - money;
cout<<m[maxst].name<<endl<<max1<<endl<<tot<<endl;
}