Run ID:70064

提交时间:2024-04-13 15:30:56

# 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; } if(x==1){ d[x]++; tot++; } if(x==2){ d[x]++; tot++; } if(x==3){ d[x]++; tot++; } } 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"; return 0; }