1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| #include <iostream> #include <algorithm> using namespace std; const int N = 100; int T; int n; int a[N]; int main() { cin >> T; while (T--) { cin >> n; for (int i = 0; i < n; ++i) cin >> a[i]; sort(a, a + n, greater<int>()); for (int i = 0; i < n; ++i) cout << a[i] << " "; cout << endl; } return 0; }
|