#include<iostream> using namespace std; int main() { int n, i =0, A = 0, B = 0, C = 0,k; while (cin >> n) { if (n == -1)break; if(n==1||n==2||n==3)i++; if (n == 1)A++; if (n == 2)B++; if (n == 3)C++; k++; } cout << "A=" << A<< endl; cout << "B=" <<B << endl; cout << "C=" << C << endl; cout << "Tot=" << i << endl; if (A>=k/2)cout << "A - yes" << endl; else if (B>=k/2)cout << "B - yes" << endl; else if (C>=k/2)cout << "C - yes" << endl; else cout << "all-NO"; return 0; }
全部评论
(1) 回帖