一直报错,没发现什么问题,谁能帮我看看啊

P1104 生日

@[Bramble_Marshall](/user/1059049) 变量名 a 和结构体名重复了,改一下就好了。 ``` #include <bits/stdc++.h> using namespace std; const int N = 1e2+5; string input() { char t; string ans = ""; t = getchar(); while (t == ' ' || t == '\n') t = getchar(); while (t != EOF && t != ' ' && t != '\n') { ans += t; t = getchar(); } return ans; } void prints(string iut) { long long n = iut.size(); for (int i = 0; i <= n; i++) putchar(iut[i]); } struct node { string n; int d; } a[N]; bool cmp(node a, node b) { return a.d < b.d; } int main() { int m, x, b, c; scanf("%d", &m); for (int i = 1; i <= m; i++) { a[i].n = input(); scanf("%d %d %d", &x, &b, &c); a[i].d = ((x * 1e2 + b) * 1e2 + c) * 1e3 + 100 - i; } sort(a + 1, a + m + 1, cmp); for (int i = 1; i <= 3; i++) prints(a[i].n); return 0; }
by Hatsunatsu @ 2023-11-28 07:17:10


@[Hatsunatsu](/user/1079073) 好的,谢谢
by Bramble_Marshall @ 2023-11-28 18:22:48


|