Run ID:77349
提交时间:2024-06-08 21:54:54
#include<bits/stdc++.h> using namespace std; int a,b,c,d; long long n=1; int main(){ while(d!=-1){ cin>>d; if(d==1){ a++; } if(d==2){ b++; } if(d==3){ c++; } n+=1; } if((n-2)%2!=0){ cout<<'A'<<'='<<a<<endl; cout<<'B'<<'='<<b<<endl; cout<<"C"<<'='<<c<<endl; cout<<"Tot"<<'='<<(n-2)<<endl; cout<<"all"<<'-'<<"NO"<<endl; } if(a>(n-2)/2){ cout<<'A'<<'='<<a<<endl; cout<<'B'<<'='<<b<<endl; cout<<"C"<<'='<<c<<endl; cout<<"Tot"<<'='<<(n-2)<<endl; cout<<"A"<<'-'<<"yes"<<endl; } if(b>(n-2)/2){ cout<<'A'<<'='<<a<<endl; cout<<'B'<<'='<<b<<endl; cout<<"C"<<'='<<c<<endl; cout<<"Tot"<<'='<<(n-2)<<endl; cout<<"B"<<'-'<<"yes"<<endl; } if(c>=n-2)/2){ cout<<'A'<<'='<<a<<endl; cout<<'B'<<'='<<b<<endl; cout<<"C"<<'='<<c<<endl; cout<<"Tot"<<'='<<(n-2)<<endl; cout<<"C"<<'-'<<"yes"<<endl; } }