Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
126903 | 张永良 | 19选班长II | C++ | Accepted | 4 MS | 272 KB | 558 | 2025-07-22 14:14:28 |
#include <iostream> using namespace std; int main() { int a1 = 0, b = 0, c = 0, tot = 0; for (;;) { int a; cin >> a; if (a == -1) { break; } tot++; if (a == 1) { a1++; } if (a == 2) { b++; } if (a == 3) { c++; } } cout << "A=" << a1 << endl << "B=" << b << endl << "C=" << c << endl << "Tot=" << tot << endl; if (a1 * 2 > tot) { cout << "A-yes"; } else if (b * 2 > tot) { cout << "B-yes"; } else if (c * 2 > tot) { cout << "C-yes"; } else { cout << "all-NO"; } return 0; }