Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
113729 | 尚雨钒 | 初级冒泡排序 | C++ | Accepted | 4 MS | 280 KB | 336 | 2025-03-16 14:03:25 |
#include<bits/stdc++.h> using namespace std; int n; int a[2001],y; int main() { cin>>n; for(int b=0;b<n;b++){ cin>>a[b]; } for(int i=0; i<n; i++) { for(int j=0;j<n-i-1;j++){ if(a[j]<a[j+1]){ y=a[j+1]; a[j+1]=a[j]; a[j]=y; } } } for(int t=0;t<n;t++){ cout<<a[t]<<" "; } return 0; }