Run ID:102431
提交时间:2024-12-21 16:11:51
#include <iostream> using namespace std; int main(){ int a[1000]={},n,t,j,i,tot,max=0; for(i=1;;i++){ cin >>t; if(t==-1){ break; } j++; a[t]++; } cout << "A="<<a[1]<<endl; cout << "B="<<a[2]<<endl; cout << "C="<<a[3]<<endl; cout << "Tot="<<j<<endl; if(a[1]>j/2) cout <<"A-yes"<<endl; else if(a[2]>j/2) cout << "B-yes"<<endl; else if (a[3]>j/2){ cout << "C-yes"<<endl; } else{ cout << "all-NO"<<endl; } return 0; }