| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 146985 | 李明秦 | 打印每一趟冒泡排序 | C++ | Accepted | 1 MS | 280 KB | 357 | 2026-02-01 17:05:08 |
#include<bits/stdc++.h> using namespace std; int main(){ int n,a[2001]; cin>>n; for(int i=0;i<=n-1;i++){ cin>>a[i]; } int t; for(int i=0;i<n-1;i++){ for(int j=0;j<n-1-i;j++){ if(a[j]>a[j+1]){ t=a[j]; a[j]=a[j+1]; a[j+1]=t; } } for(int y=0;y<n;y++){ cout<<a[y]<<" "; }cout<<endl; } return 0; }