Run ID:102435

提交时间:2024-12-21 16:13:10

#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() 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; }