Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
123175 刘明沅 19众数 C++ Compile Error 0 MS 0 KB 367 2025-06-28 12:27:19

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int a[n]; for(int i=0;i<n;i++){ cin>>a[i]; } int m=1001; for(int i=1;i<m;i++){ b[i]=0; } for(int i=0;i<n;i++){ cout<<b[i]<<" "; } int s=1; for(int i=2;i<m;i++){ if(b[i]>b[s]){ s=i; } } cout<<s; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:12:3: error: 'b' was not declared in this scope
   b[i]=0;
   ^
Main.cc:15:9: error: 'b' was not declared in this scope
   cout<b[s]){
      ^