Run ID:75961
提交时间:2024-06-01 11:35:18
#include <bits/stdc++.h> using namespace std; int main () { int tong[4]={0}; int tot=0; int p; while(1){ cin>>p; if(p==-1){ break; } tot++; if(p>=1&&p<=3){ tong[p]++; } } cout<<"A="<<tong[1]<<endl; cout<<"B="<<tong[2]<<endl; cout<<"C="<<tong[3]<<endl; cout<<"Tot="<<tot; double kl=tot/2; for(int i=1;i<=3;i++){ if(tong[i]>kl){ cout<<tong[i]<<"-"<<"Yes"; return 0; } } cout<<"all-NO"; return 0; }