Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
141343 黄枳润 打印每一趟选择排序 C++ Compile Error 0 MS 0 KB 694 2025-12-22 18:59:03

Tests(0/0):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n,t; cin>>n; int a[n]; for(int i=0;i<n;i++){ cin>>a[i]; } for(int i=0;i<n-1;i++){ for(int j=1;j<n-1-i;j++){ for(int z=;z<n-1-i;z++) if(a[j]>a[j+z]){ t=a[j]; a[j]=a[j+z]; a[j+z]=t; } } for(int i=0;i<n;i++){ cout<<a[i]<<' '; } } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:16:23: error: expected primary-expression before ';' token
             for(int z=;z