讨论 / C++的解
sunnyboy 2020-11-04 18:47:37
点我顶贴 收藏 删除
#include<cstdio>

#include<cstring>

using namespace std;

char na[100][20];

int main()

{

char c1,c2;

int N,s1,s2,num,mm=0,r=0,all=0,a,b;

scanf("%d",&N);

for(int c=1;c<=N;c++)

{

int score=0;

scanf("%s %d %d %c %c %d",&na[c],&s1,&s2,&c1,&c2,&num);

a=c1=='Y'? 1:0;

b=c2=='Y'? 1:0;

if((s1>80)&&(num>0)) score=score+8000;

if((s1>85)&&(s2>80)) score=score+4000;

if(b&&(s1>85)) score=score+1000;

if(s1>90) score=score+2000;

if(a&&(s2>80)) score=score+850;

if(score>mm) {mm=score;r=c;

}

all=all+score;

}

printf("%s\n%d\n%d\n",na[r],mm,all);

return 0;

}

查看更多回复
提交回复