Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
88063 倪士燊 19选班长II C++ Compile Error 0 MS 0 KB 572 2024-08-17 11:48:45

Tests(0/0):


Code:

using namespace std; int t[4]; int main(){ int p; int sum = 0; for(int i=0;;i++){ cin >> p; if(p == -1){ break; } if(p<=3&&p>=1){ t[p]++; } sum++; } cout << "A="<<t[1]<<endl; cout << "B="<<t[2]<<endl; cout << "C="<<t[3]<<endl; cout << "Tot="<<sum<<endl; if(t[1]>sum/2){ cout << "A-yes" << endl; }else if(t[2]>sum/2){ cout << "B-yes" << endl; }else if(t[3]>sum/2){ cout << "C-yes" << endl; }else{ cout << "all-NO" << endl; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:7:9: error: 'cin' was not declared in this scope
         cin >> p;
         ^
Main.cc:16:5: error: 'cout' was not declared in this scope
     cout << "A="<