短短的题解
2024-06-10 09:03:05
发布于:浙江
4阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
struct student{
string name;
int qm,bj;
char xs,xb;
int lw,mon;
}a[114];
int main(){
int n;
cin>>n;
for(int i = 1;i<=n;i++){
cin>>a[i].name>>a[i].qm>>a[i].bj>>a[i].xs>>a[i].xb>>a[i].lw;
}
for(int i = 1;i<=n;i++){
if(a[i].qm>80&&a[i].lw>=1)a[i].mon+=8000;
if(a[i].qm>85&&a[i].bj>80)a[i].mon+=4000;
if(a[i].qm>90)a[i].mon+=2000;
if(a[i].qm>85&&a[i].xb=='Y')a[i].mon+=1000;
if(a[i].bj>80&&a[i].xs=='Y')a[i].mon+=850;
}
int sum = 0;
int mx = 1;
for(int i = 1;i<=n;i++){
sum+=a[i].mon;
if(a[mx].mon<a[i].mon)mx=i;
}
cout<<a[mx].name<<"\n"<<a[mx].mon<<"\n"<<sum;
return 0;
}
这里空空如也
有帮助,赞一个