| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 146980 | 李朋秦 | 初级冒泡排序 | C++ | Accepted | 4 MS | 280 KB | 337 | 2026-02-01 16:23:26 |
#include<bits/stdc++.h> 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++){ for(int j=n-1;j>i;j--){ if(a[j]<a[j-1]){ int x=a[j]; a[j]=a[j-1]; a[j-1]=x; } } }for(int i=n-1;i>=0;i--)cout<<a[i]<<" "; return 0; }