Run ID:126909

提交时间:2025-07-22 14:22:45

#include<bits/stdc++.h> using namespace std; int main() { int b[4]; for (int i = 1; i < 4; i++) { b[i] = 0; } int count = 0; for (int i = 1;; i++) { int x; cin >> x; if (x == -1) { break; } count++; b[x]++; } cout << "A=" << b[1] << endl; cout << "B=" << b[2] << endl; cout << "C=" << b[3] << endl; cout << "Tot=" << count << endl; double s = count*1.0 / 2; if (b[1] > s) { cout << "A-yes"; } else { if (b[2] > s) { cout << "B-yes"; } else { if (b[3] > s) { cout << "C-yes"; } else { cout << "all-NO"; } } } return 0; }