什么玩意(编译错误)

P1093 [NOIP2007 普及组] 奖学金

FJ_00460 @ 2023-01-06 19:20:29


#include<bits/stdc++.h>
using namespace std;
struct money{
    int zong, chinese, math, english, id;
}mon[305];
bool cmp(money a, money b)
{
    if(a.zong != b.zong)return a.zong > b.zong;
    if(a.chinese != b.chinese)return a.chinese > b.chinese;
    return a.id > b.id;
}
int main{
    int n;
    cin >> n;
    for(int i = 1 ; i <= n; i++)
    {
        cin >> mon[i].chinese >> mon[i].math >> mon[i].english;
        mon[i].id = i;
        min[i].zong = mon[i].chinese + mon[i].math + mon[i].english;
    }
    sort(mon + 1, mon + n + 1, cmp);
    for(int i = 1 ; i <= n ; i++)
    {
        cout << mon[i].id << mon[i].zong;
    }
    return 0;
}```

by zhuweiqi @ 2023-01-06 19:25:05

你倒数第9行第1个的 mon 写成 min 了吧?


by cff_0102 @ 2023-01-06 19:28:15

6


by lzx0 @ 2023-01-06 20:13:57

最后一行括号外面是什么???


by whljy @ 2023-02-26 09:08:09

@ lzx0 “```” 是发代码的标准


by juchenglin @ 2023-03-30 21:22:32

@whljy 为什么开头没有3个引号(不懂就问)?


by whljy @ 2023-04-16 12:24:00

@juchenglin 你猜?


|