Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
103885 | 小徐老师 | 19选班长II | C++ | Accepted | 1 MS | 276 KB | 722 | 2024-12-31 19:16:24 |
#include <bits/stdc++.h> using namespace std; int main() { int A = 0, B = 0, C = 0, s = 0; while(1) { int x; cin >> x; if(x == -1) break; s = s + 1; if(x == 1) A = A + 1; if(x == 2) B = B + 1; if(x == 3) C = C + 1; } cout << "A=" << A << '\n'; cout << "B=" << B << '\n'; cout << "C=" << C << '\n'; cout << "Tot=" << s << '\n'; if(A > s / 2) cout << "A-yes" << '\n'; else if(B > s / 2) cout << "B-yes" << '\n'; else if(C > s / 2) cout << "C-yes" << '\n'; else cout << "all-NO" << '\n'; return 0; }