Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
2485 杨洋杰 19选班长II C++ Wrong Answer 0 MS 256 KB 539 2024-01-06 18:02:22

Tests(0/10):


Code:

#include<iostream> using namespace std; int main(){ int a,n[4]={0},s,d=0,i=0; while(1){ cin>>s; if(s==-1)break; n[s]++; d++; } cout<<"A="<<n[1]<<endl<<"B="<<n[2]<<endl<<"C="<<n[3]<<endl<<"Tot="<<d<<endl; if(n[1]>=d/2) cout<<"A-yes"<<endl; else i++; if(n[2]>=d/2) cout<<"B-yes"<<endl; else i++; if(n[3]>=d/2) cout<<"C-yes"<<endl; else i++; if(i==3) cout<<"all-No"<<endl; return 0; }


Run Info:

------Input------
1 3 3 1 1 1 2 1 4 4 3 4 1 3 2 3 1 2 3 4 4 2 1 1 4 4 2 4 3 3 3 4 4 2 2 3 1 1 2 1 4 2 3 -1
------Answer-----
A=12 B=9 C=11 Tot=43 all-NO
------Your output-----
A=12 B=9 C=11 Tot=43 all-No