Run ID:61348
提交时间:2023-12-03 17:44:36
#include<bits/stdc++.h> using namespace std; int main(){ int xz[4] = {0},sum = 0; int p; while (1){ cin >> p; if(p == -1){ break; } sum++; if(p > 0 && p < 4 ){ xz[p]++; } } cout << "A="<<xz[1]<<endl; cout << "B="<<xz[2]<<endl; cout << "C="<<xz[3]<<endl; cout << "Tot="<<sum <<endl; double b =sum/2; if (xz[1]>b){ cout << "A-yes"; } else if(xz[2]>b){ cout << " B-yes"; } else if(xz[3]>b){ cout << "C-yes"; }else{ cout << "all-NO"; } return 0; }