我……我要……炸了,爆0了!!!
查看原帖
我……我要……炸了,爆0了!!!
772815
一咕咕一楼主2024/7/17 22:16

样例过了,但是爆0,全WA了呜呜呜!!!

#include <bits/stdc++.h>
using namespace std;
int n;
class Student
{
public:
    string s;
    int a, b, c, z;
};
void solve(void)
{
    cin >> n;
    Student maxn;
    for (int i = 1; i <= n; i++)
    {
        Student a;
        cin >> a.s >> a.a >> a.b >> a.c;
        a.z = a.a + a.b + a.c;
        if (a.z > maxn.z)
        {
            maxn = a;
        }
    }
    cout << maxn.s << ' ' << maxn.a << ' ' << maxn.b << ' ' << maxn.c;
    return;
}
int main()
{
    // freopen(".in","r",stdin);
    // freopen(".out","w",stdout);
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    solve();

    return 0;
}

我是被深基迫害重写这题的呜呜呜

2024/7/17 22:16
加载中...