| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 108732 | 陈铎文 | 19选班长II | C++ | Compile Error | 0 MS | 0 KB | 560 | 2025-01-21 15:29:45 |
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int a[10001],A=0,B=0,C=0,d,i=1,s=0; while(a[i]==-1){ cin>>a[i]; i++; s+=a[i]; } for(int j=1;j<=i;j++){ if(a[i]==1){ A++; } else if(a[i]==2){ B++; } else if(a[i]==3){ C++; } } cout<<"A="<<A<<endl; cout<<"B="<<B<<endl; cout<<"C="<<C<<endl; cout<<"Tot="<<s<<endl; if(a>s/2){ cout<<"A-yes"; } else if(B>s/2){ cout<<"B-yes"; } else if(C>s/2){ cout<<"C-yes"; } else{ cout<<"all-NO"; } return 0; }
Main.cc: In function 'int main()':
Main.cc:27:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
if(a>s/2){
^
Main.cc:6:27: warning: unused variable 'd' [-Wunused-variable]
int a[10001],A=0,B=0,C=0,d,i=1,s=0;
^