Run ID:84526
提交时间:2024-07-16 09:52:30
#include<bits/stdc++.h> using namespace std; int tong[4]; int main(){ 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<<endl; double kl=tot/2; for(int i=1;i<=3;i++){ if(tong[i]>kl){ cout<<(char)(i+64)<<"-"<<"yes"; return 0; } } cout<<"all-NO"; return 0; }