Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
140020 王培臻 19选班长II C++ Compile Error 0 MS 0 KB 475 2025-12-13 14:37:13

Tests(0/0):


Code:

#include <bits/stdc++.h> using namespace std; int main (){ long long d=0,a[4]={0},s=0; while(a!=-1){ cin>>d; if(a>=1 and a<=3){ a[d]++; } s++; } cout<<"A="<<a[1]<<endl; cout<<"B="<<a[2]<<endl; cout<<"c="<<a[3]<<endl; cout<<"Tot="<<s-1<<endl; if(a[1]>(s-1)/2){ cout<<"A-yes"; }else{ if(a[2]>(s-1)/2){ cout<<"A-yes"; }else{ if(a[3]>(s-1)/2){ cout<<"A-yes"; }else{ cout<<"all-NO"; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:5:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
  while(a!=-1){
            ^
Main.cc:7:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   if(a>=1 and a<=3){
         ^
Main.cc:7:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   if(a>=1 and a<=3){
                  ^
Main.cc:30:1: error: expected '}' at end of input
 }
 ^
Main.cc:30:1: error: expected '}' at end of input