Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
122356 顾文博 19选班长II C++ Compile Error 0 MS 0 KB 706 2025-06-15 15:37:49

Tests(0/0):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int a[4]={0},Tot=0,x,A,B,C; while(cin>>x && x!=-1){ Tot++; a[x]+=1; } A=a[1];B=a[2];c=a[3]; cout<<"A="<<A<<endl; cout<<"B="<<B<<endl; cout<<"C="<<C<<endl; cout<<"Tot="<<Tot<<endl; if(A>Tot/2){ cout<<"A-yes"; } else if(B>Tot/2){ cout<<"B-yes"; } else if(C>Tot/2){ cout<<"C-yes"; } else{ cout<<"all-NO"; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:13:19: error: 'c' was not declared in this scope
     A=a[1];B=a[2];c=a[3];
                   ^