Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
61816 夏轩淇 处理随机数 C++ Compile Error 0 MS 0 KB 332 2023-12-10 17:08:05

Tests(0/0):


Code:

#include<iostream> using namespace std; int main() { int tmp,n,a[100001]= {0}; cin>>n; for(int i=1; i<=n; i++) { cin>>tmp; a[tmp]++; } int sum=0; for(int s=0; s<100001; s++) { if(a[i]!=0){ sum++ } } for(int s=0; s<100001; s++) { if(a[i]!=0){ cout<<s<<" " } } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:12:11: error: 'i' was not declared in this scope
      if(a[i]!=0){
           ^
Main.cc:14:3: error: expected ';' before '}' token
   }
   ^
Main.cc:17:11: error: 'i' was not declared in this scope
      if(a[i]!=0){
           ^
Main.cc:19:3: error: expected ';' before '}' token
   }
   ^