救民于水火

x-hechengye 2022-08-09 16:04:56 19 返回题目

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