0
已解决
曹博扬
初级天翼
初级天翼
#include<iostream>
#include<algorithm>
#include<cstdio>//头文件
#include<string>
#include<cmath>
using namespace std;
int n,sum;
struct jj{
string name;
int qm,py;
char x,y;
int p;
int s,idx;
}a[1001];
int j(jj x){
int s=0;
if(x.qm>=80&&x.p>=1){
s+=8000;
}
if(x.qm>=85&&x.py>=80){
s+=4000;
}
if(x.qm>=90){
s+=2000;
}
if(x.qm>=85&&x.y=='Y'){
s+=1000;
}
if(x.x=='Y'&&x.py>=80){
s+=850;
}
return s;
}
bool cmp(jj x,jj y){
if(x.s!=y.s)
return x.s>y.s;
return x.idx<y.idx;
}
int main(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i].name>>a[i].qm>>a[i].py>>a[i].x>>a[i].y>>a[i].p;
a[i].s=j(a[i]);
sum+=a[i].s;
a[i].idx=i;
}
sort(a+1,a+n+1,cmp);
cout<<a[1].name<<endl;
cout<<a[1].s<<endl;
cout<<sum<<endl;
return 0;
}
20分代码,萌新求找错
0
0
0
0
0
0