哪里错了,www 题目在这里
蒟蒻代码↓
#include<bits/stdc++.h>
using namespace std;
int n,js,maxn = -1;
struct students{
string name;
char work,west;
int final_score,score,money,num;
}student[101];
int qian(int n){
if(student[n].work == 'Y' and student[n].score > 80){
student[n].money += 850;
}
if(student[n].final_score > 80 and student[n].num >= 1){
student[n].money += 8000;
}
if(student[n].final_score >= 85 and student[n].score > 80){
student[n].money += 4000;
}
if(student[n].final_score > 90){
student[n].money += 2000;
}
if(student[n].west == 'Y' and student[n].final_score > 85){
student[n].money += 1000;
}
return student[n].money ;
}
int main(){
int l;
cin>>n;
for(int i=0;i<n;++i){
cin>>student[i].name >>student[i].final_score >>student[i].score>>student[i].work>>student[i].west>>student[i].num;
}
for(int i=0;i<n;++i){
js += qian(i);
if(student[i].money > maxn){
l = i;
maxn = student[i].money;
}else if(student[i].money <= maxn){
l = l;
maxn = maxn;
}
}
cout<<student[l].name<<endl<<student[l].money<<endl<<js;
return 0;
}