Run ID:107613
提交时间:2025-01-18 10:46:15
#include<iostream> using namespace std; int p[4]; int main(){ int a,b,c,d=0,n; while(1){ cin>>n; if(n==-1){ break; } else{ d++; if(n>=1&&n<=3){ p[n]++; } } } cout<<"A"<<"="<<p[1]<<endl; cout<<"B"<<"="<<p[2]<<endl; cout<<"C"<<"="<<p[3]<<endl; cout<<"Tot"<<"="<<d<<endl; if(p[1]>d/2){ cout<<"A-yes"<<endl; } else if(p[2]>d/2){ cout<<"B-yes"<<endl; } else if(p[3]>d/2){ cout<<"C-yes"<<endl; } else{ cout<<"all-NO"<<endl; } }