提交时间:2024-08-19 19:04:13
运行 ID: 50331
#include<bits/stdc++.h> using namespace std; struct student{ string name; int as,cs,p,ss; char ls,ws; }; int main(){ int n,maxn=-1,k,sum=0; cin>>n; student a[1000]; for(int i=0;i<n;i++){ cin>>a[i].name>>a[i].as>>a[i].cs>>a[i].ls>>a[i].ws>>a[i].p; if(a[i].as>80&&a[i].p>=1){ a[i].ss+=8000; } if(a[i].as>85&&a[i].cs>80){ a[i].ss+=4000; } if(a[i].as>90){ a[i].ss+=2000; } if(a[i].as>85&&a[i].ws=='Y'){ a[i].ss+=1000; } if(a[i].cs>80&&a[i].ls=='Y'){ a[i].ss+=850; } } for(int i=0;i<n;i++){ if(a[i].ss>maxn){ maxn=a[i].ss; k=i; } sum+=a[i].ss; } cout<<a[k].name<<endl<<a[k].ss<<endl<<sum; }