Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
7108 刘芃伽 19从小到大进行排序 C++ Compile Error 0 MS 0 KB 348 2025-04-05 09:54:56

Tests(0/0):


Code:

#include<bits/stdc++.h> #include<cstdio> using namespace std; int main(){ int a[100001]={}; int n,temp; cin>>n; for(i=1;i<=n;i++){ cin>>temp;//输入未更新的数组 a[temp]++;// } for(int i=0;i<=100000;i++){ while(a[i]--){ cout<<i<<" "; } } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:8:9: error: 'i' was not declared in this scope
     for(i=1;i<=n;i++){
         ^