题解(老师教的100%对)
2024-07-11 11:16:34
发布于:浙江
6阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
long long n,x,num=0,zuigao=0,ming;
struct asdfg{
string name,xueshengbu,xibushengfen;
int chengji,gongxian,lunwen,sum;
}a[100000];
void panduan(int q){
if(a[q].chengji>80&&a[q].lunwen>=1){
a[q].sum+=8000;
}
if(a[q].chengji>85&&a[q].gongxian>80){
a[q].sum+=4000;
}
if(a[q].chengji>90){
a[q].sum+=2000;
}
if(a[q].chengji>85&&a[q].xibushengfen=="Y"){
a[q].sum+=1000;
}
if(a[q].gongxian>80&&a[q].xueshengbu=="Y"){
a[q].sum+=850;
}
}
int main()
{
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i].name>>a[i].chengji>>a[i].gongxian>>a[i].xueshengbu>>a[i].xibushengfen>>a[i].lunwen;
a[i].sum=0;
}
for(int i=1;i<=n;i++){
panduan(i);
}
for(int i=1;i<=n;i++){
num+=a[i].sum;
}
zuigao=a[1].sum;
ming=1;
for(int i=2;i<=n;i++){
if(a[i].sum>zuigao){
zuigao=a[i].sum;
ming=i;
}
}
cout<<a[ming].name<<endl;
cout<<zuigao<<endl;
cout<<num<<endl;
return 0;
}
全部评论 1
看完点个赞吧!!!
2024-07-11 来自 浙江
1
有帮助,赞一个