| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 61311 | 段文昊 | 19选班长II | C++ | Compile Error | 0 MS | 0 KB | 524 | 2023-12-03 17:26:04 |
#include<iostream> #include<cstdio> using namespace std; int main(){ double xz[4] = {0}; double p,sum=0; while(1){ cin >> p; if(p == -1){ break; } sum++; if(p > 0 && p < 4){ xz[p]++; } cout<< "A=" <<xz[1]<< endl; cout<< "B=" <<xz[2]<< endl; cout<< "c=" <<xz[3]<< endl; cout<< "Tot=" <<sum<<endl; } if(xz[1]>sum/2){ cout<<"A-yes" } else if(xz[2]>sum/2){ cout<<"B-yes" } else if(xz[3]>sum/2){ cout<<"C-yes" } else{ cout<<"All-no"; } return 0; }
Main.cc: In function 'int main()':
Main.cc:14:7: error: invalid types 'double [4][double]' for array subscript
xz[p]++;
^
Main.cc:23:2: error: expected ';' before '}' token
}
^
Main.cc:26:2: error: expected ';' before '}' token
}
^
Main.cc:29:2: error: expected ';' before '}' token
}
^