Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
84531 游四鑫 19选班长II C++ Wrong Answer 1 MS 276 KB 469 2024-07-16 09:53:34

Tests(1/10):


Code:

#include<iostream> using namespace std; int main(){ int a; int n,x=0,y=0,z=0,max=0,i=0; cin>>n; while(a!=-1){ i++; cin>>a; if(a==1)x++; if(a==2)y++; if(a==3)z++; if(a==-1){ break; } } printf("A=%d\n",x); printf("B=%d\n",y); printf("C=%d\n",z); printf("Tot=%d\n",i); if(x>i/2.0) printf("A-yes\n"); else if(y>i/2.0) printf("B-yes\n"); else if(z>i/2.0) printf("C-yes\n"); else printf("all-NO\n"); 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=11 B=9 C=11 Tot=43 all-NO