Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
151967 田子熙 打印每一趟插入排序 C++ Compile Error 0 MS 0 KB 324 2026-04-19 12:36:57

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int a[1e9]; int main(){ int n; cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; } for(int i=0;i<n;i++){ for(int j=0;j<n+1;j++){ if(a[j]>a[j+1]){ swap(a[i],a[i+1]); } } for(int b=0;b<n;b++){ cout<<a[b]<<" "; } cout<<endl; } return 0; }


Run Info:

Main.cc:3:10: error: size of array 'a' has non-integral type 'double'
 int a[1e9];
          ^