Run ID:122357
提交时间:2025-06-15 15:38:37
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int a[4]={0},Tot=0,x,A,B,C; while(cin>>x && x!=-1){ Tot++; a[x]+=1; } A=a[1];B=a[2];C=a[3]; cout<<"A="<<A<<endl; cout<<"B="<<B<<endl; cout<<"C="<<C<<endl; cout<<"Tot="<<Tot<<endl; if(A>Tot/2){ cout<<"A-yes"; } else if(B>Tot/2){ cout<<"B-yes"; } else if(C>Tot/2){ cout<<"C-yes"; } else{ cout<<"all-NO"; } return 0; }