Run ID:70061
提交时间:2024-04-13 15:28:12
# include<iostream> # include<cstring> # include<cmath> using namespace std; int main() { int tot=0,d[10000]={0},x; while(1){ cin>>x; if(x==-1){ break; tot++; } if(x==1){ d[x]++; } if(x==2){ d[x]++; } if(x==3){ d[x]++; } } cout<<"A="<<d[1]<<endl<<"B="<<d[2]<<endl<<"C="<<d[3]<<endl<<"Tot"<<tot<<endl; if(d[1]==tot/2){ cout<<"A-yes"; } else if(d[2]>=tot/2){ cout<<"B-yes";} else if(d[2]>=tot/2){ cout<<"C-yes";} else cout<<"all-NO";