为什么我这个程序可以过9个,倒数第二个过不了??

#include<bits/stdc++.h>
#define N 1005
using namespace std;
int n;
int all=0;
struct node{
int poi,eti,pap,mon;
bool wes,cad;
string name;
}stu[N];

bool cmp(const node &a,const node &b){
return a.mon>b.mon;
}

int main(){
scanf("%d",&n);
for(int i=1;i<=n;++i){
cin>>stu[i].name;
scanf("%d%d",&stu[i].poi,&stu[i].eti);
stu[i].mon=0;
char pd;
cin>>pd;
if(pd=='N') stu[i].cad=false;
else stu[i].cad=true;
cin>>pd;
if(pd=='Y') stu[i].wes=true;
else stu[i].wes=false;
scanf("%d",&stu[i].pap);
}
for(int i=1;i<=n;++i){
if(stu[i].poi>80&&stu[i].pap>=1){
stu[i].mon+=8000;
all+=8000;
}
if(stu[i].poi>85&&stu[i].eti>80){
stu[i].mon+=4000;
all+=4000;
}
if(stu[i].poi>90){
stu[i].mon+=2000;
all+=2000;
}
if(stu[i].poi>85&&(stu[i].wes==1)){
stu[i].mon+=1000;
all+=1000;
}
if(stu[i].eti>80&&(stu[i].cad==1)){
stu[i].mon+=850;
all+=850;
}

}
sort(stu+1,stu+n+1,cmp);
cout<<stu[1].name<<"\n";
printf("%d\n",stu[1].mon);
printf("%d",all);
return 0;
}

0 条评论

目前还没有评论...

信息

ID
1001
难度
5
分类
模拟 点击显示
标签
递交数
39062
已通过
12710
通过率
33%
被复制
121
上传者