using namespace std;
int main()
{
int anum[1000];
int i=0,a=0,b=0,c=0;
while(scanf("%d",&anum[i])!=-1)
{
if(anum[i]==1)
a++;
else if(anum[i]==2)
b++;
else if(anum[i]==3)
c++;
i++;
}
cout<<"A="<<a<<endl;
cout<<"B="<<b<<endl;
cout<<"C="<<c<<endl;
int sum=i-1;
sum=sum/2;
cout<<"Tot="<<a+b+c<<endl;
if(a>sum)
cout<<"A-yes"<<endl;
else if(b>sum)
cout<<"B-yes"<<endl;
else if(c>sum)
cout<<"C-yes"<<endl;
else
cout<<"all-NO"<<endl;
return 0;
}
全部评论
(0) 回帖