无法理解哪里错了。。。

// #include <cstdio>
#include <iostream>
#include <cstring>
using namespace std;
struct node{
    char name[50];
    int score1;
    int score2;
    char str1[5];
    char str2[5];
    int a;
    int money;
};
int n;
node stu[200];
char name[110][100];
int main(){
    scanf ("%d",&n);
    int ma=0,tot=0;
    char ans[50];
    for (int i=1;i<=n;i++){
        stu[i].money=0;
        scanf ("%s%d%d%s%s%d",stu[i].name,&stu[i].score1,&stu[i].score2,stu[i].str1,stu[i].str2,&stu[i].a);
        if (stu[i].score1>80&&stu[i].a) stu[i].money+=8000;
        if (stu[i].score1>85&&stu[i].score2>80) stu[i].money+=4000;
        if (stu[i].score1>90) stu[i].money+=2000;
        if (stu[i].score1>85&&stu[i].str2[0]=='Y') stu[i].money+=1000;
        if (stu[i].score1>80&&stu[i].str1[0]=='Y') stu[i].money+=850;
        tot+=stu[i].money;
        if (stu[i].money>ma){
            ma=stu[i].money;
            strcpy(ans,stu[i].name);
        }
    }
    printf ("%s\n%d\n%d\n",ans,ma,tot);
    return 0;
}

1 条评论

  • @ 2016-03-28 22:08:59

    呃。。。有个2写成1了。。。已过

  • 1

信息

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