哪错了啊QAQ

#include<cstdio>
#include<algorithm>
#include<iostream>
#include<string>
const int E = 1e3 +10;
using namespace std;
int n, all_money;
struct stu
{
    string name;
    int soc1;
    int soc2;
    char post;
    char west;
    int pas;
    int money = 0;
} a[E];
bool cmp(stu a, stu b)
{
    return (a.money == b.money) ? (a.name > b.name) : (a.money > b.money);
}
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    for (int i=1; i<=n; i++)
    {
        cin >> a[i].name;
        cin >> a[i].soc1 >> a[i].soc2;
        cin >> a[i].post >> a[i].west;
        cin >> a[i].pas;
    }
    for (int i=1; i<=n; i++)
    {
        if (a[i].soc1 > 80 && a[i].pas >= 1)
            a[i].money += 8000;
        if (a[i].soc1 > 85 && a[i].soc2 > 80)
            a[i].money += 4000;
        if (a[i].soc1 > 90)
            a[i].money += 2000;
        if (a[i].soc1 > 85 && a[i].west == 'Y')
            a[i].money += 1000;
        if (a[i].soc2 > 80 && a[i].post == 'Y')
            a[i].money += 850;
        all_money += a[i].money;
    }
    sort(a+1, a+n+1, cmp);
    cout << a[1].name << endl << a[1].money << endl << all_money << endl;
    return 0;
}

兄嘚集美们到底哪错了啊_____

1 条评论

  • 1

信息

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