Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
123506 郭玉洁 19选班长II C++ Wrong Answer 1 MS 272 KB 563 2025-07-05 13:04:17

Tests(0/10):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int a1=0; int a2=0; int a3=0; int x; cin>>x; if (x==1){ a1++; } if(x==2){ a2++; } if(x==3){ a3++; } int tot=1; while(x!=-1){ cin>>x; if(x!=-1){ tot++; } if (x==1){ a1++; } if(x==2){ a2++; } if(x==3){ a3++; } } cout<<"A="<<a1<<endl; cout<<"B="<<a2<<endl; cout<<"C="<<a3<<endl; cout<<"Tot="<<tot; if(a1*2>tot){ cout<<"A-yes"; }else if(a2*2>tot){ cout<<"B-yes"; }else if(a3*2>tot){ cout<<"C-yes"; }else{ cout<<"all-NO" ; } return 0; }


Run Info:

------Input------
4 3 4 2 1 3 1 4 1 4 1 2 1 3 3 1 3 4 3 1 4 4 4 4 4 4 4 4 1 1 4 4 1 2 4 3 4 2 1 2 1 3 3 3 -1
------Answer-----
A=12 B=5 C=10 Tot=44 all-NO
------Your output-----
A=12 B=5 C=10 Tot=44all-NO