直接上代码!
#include<bits/stdc++.h>
using namespace std;
struct node{string xm;int qm,bj;char xsgb,xbxs;int lws;int ans;int sum;
}a[101];
bool cmp(node a,node b){if(a.ans==b.ans)return a.sum<b.sum;else return a.ans>b.ans;
}
int total,n;
int main(){scanf("%d",&n);for(int i=1;i<=n;i++){cin>>a[i].xm>>a[i].qm>>a[i].bj>>a[i].xsgb>>a[i].xbxs>>a[i].lws;if(a[i].qm>80&&a[i].lws>=1)a[i].ans+=8000;if(a[i].qm>85&&a[i].bj>80)a[i].ans+=4000;if(a[i].qm>90)a[i].ans+=2000;if(a[i].xbxs=='Y'&&a[i].qm>85)a[i].ans+=1000;if(a[i].bj>80&&a[i].xsgb=='Y')a[i].ans+=850;a[i].sum=i;total+=a[i].ans;}sort(a+1,a+n+1,cmp);cout<<a[1].xm<<endl<<a[1].ans<<endl<<total;return 0;
}