劳资不行了,救命啊~~~
#include <bits/stdc++.h>
using namespace std;
int n, a[100001];
void pai() {
for (int i = 1; i <= n; i++)
for (int j = 1; j < n; j++)
if (a[j] > a[j + 1])
swap(a[j], a[j + 1]);
}
int main() {
cin >> n;
for (int i = 1; i <= n; i++)
cin >> a[i];
pai();
for (int i = 1; i <= n; i++)
cout << a[i] << ' ';
return 0;
}
各位大佬救救萌新啊!!!