Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
157236 陈骏睿 打印每一趟选择排序 C++ Wrong Answer 1 MS 280 KB 656 2026-07-21 10:54:34

Tests(1/4):


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,a[2001]={}; cin>>n; for(int i=0;i<n;i++)cin>>a[i]; for(int i=0;i<n-1;i++){ int min=i; for(int j=i+1;j<n;j++){ if(a[min]>a[j]){ int t=a[min]; a[min]=a[j]; a[j]=t; } } for(int k=0;k<n;k++)cout<<a[k]<<' '; cout<<endl; } return 0; }


Run Info:

------Input------
5 5 4 3 2 1
------Answer-----
1 4 3 2 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
------Your output-----
1 5 4 3 2 1 2 5 4 3 1 2 3 5 4 1 2 3 4 5