| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 152186 | 万骏博 | 打印每一趟插入排序 | C++ | Wrong Answer | 1 MS | 260 KB | 371 | 2026-04-21 21:39:14 |
#include <bits/stdc++.h> using namespace std; int n,a[100000],l; int main(){ scanf("%d",&n); for(int i=1;i<=n;i++){ scanf("%d",&a[i]); } for(int i=1;i<n;i++){ for(int j=n;j>=i;j--){ if(a[i]>a[j]){ int t=a[j]; a[j]=a[i]; a[i]=t; } } for(int j=1;j<=n;j++){ printf("%d ",a[j]); } printf("\n"); } return 0; }
------Input------
5 5 2 7 9 1
------Answer-----
2 5 7 9 1 2 5 7 9 1 2 5 7 9 1 1 2 5 7 9
------Your output-----
1 2 7 9 5 1 2 7 9 5 1 2 5 9 7 1 2 5 7 9