Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
127245 罗嘉为 冒泡排序法 C++ 通过 100 163 MS 288 KB 352 2024-01-25 08:28:44

Tests(21/21):


#include <bits/stdc++.h> using namespace std; int a[11000]; int main(){ int n; cin >> n; for(int i = 1; i <= n; i++){ cin >> a[i]; } for(int i = 1; i <= n; i++){ for(int j = i + 1; j <= n; j++){ if(a[i] > a[j]){ swap(a[i], a[j]); } } } for(int i = 1; i <= n; i++){ cout << a[i] << " "; } return 0; }


测评信息: