Run ID:75970

提交时间:2024-06-01 11:50:09

#include<iostream> using namespace std; int main() { int t[4]={0},tot=0; int p; while(1){ cin>>p; if(p==-1){ break; } tot++; if(p>=1&&p<=3){ t[p]++; } } cout<<"A="<<t[1]<<endl; cout<<"B="<<t[2]<<endl; cout<<"C="<<t[3]<<endl; cout<<"Tot="<<tot<<endl; if(t[1]>tot/2){ cout<<"A-yes"; }else if(t[2]>tot/2){ cout<<"B-yes"; }else if(t[3]>tot/2){ cout<<"C-yes"; }else{ cout<<"all-NO"; } return 0; }