Run ID:126903
提交时间: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; }