Run ID:155501
提交时间:2026-06-07 13:49:06
#include<bits/stdc++.h> using namespace std; int main(){ int a1=0; int a2=0; int a3=0; int x; for(int i=1;i<=10000;i++){ cin>>x; } if (x==1){ a1++; } if(x==2){ a2++; } if(x==3){ a3++; } int tot=1; while(x!=-1){ cin>>x; if(x!=-1){ tot++; } if (x==1){ a1++; } if(x==2){ a2++; } if(x==3){ a3++; } } cout<<"A="<<a1<<endl; cout<<"B="<<a2<<endl; cout<<"C="<<a3<<endl; cout<<"Tot="<<tot<<endl; if(a1*2>tot){ cout<<"A-yes"; }else if(a2*2>tot){ cout<<"B-yes"; }else if(a3*2>tot){ cout<<"C-yes"; }else{ cout<<"all-NO" ; } return 0; }