| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 85132 | 赵文浚 | 打印每一趟选择排序 | C++ | Wrong Answer | 1 MS | 272 KB | 450 | 2024-07-16 16:28:09 |
#include<bits/stdc++.h> using namespace std; int a[2001]; int main() { int n,t; cin>>n; for(int i=0;i<n;i++) { cin>>a[i]; } int min,k; for(int i=0;i<n-1;i++) { min=a[i]; k=i; for(int j=i+1;j<n;j++) { if(a[i]>a[j]) { t=a[i]; a[i]=a[j]; a[j]=t; } } for(int b=0;b<n;b++) { cout<<a[b]<<" "; } cout<<endl; } return 0; }
------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