Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
116084 李朋秦 19选班长 C++ Compile Error 0 MS 0 KB 286 2025-04-06 10:24:00

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int n,a,b[100]={},max=0,anx=0; cin>>n; for(int i=1;i<3*n;i++) { cin>>a; b[a]++; } for(int i=1;i<=n;i++) { if(b[i]>max) { max=b[i]; ans=i; } } cout<<ans; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:17:4: error: 'ans' was not declared in this scope
    ans=i;
    ^
Main.cc:20:8: error: 'ans' was not declared in this scope
  cout<