Advertisement
Josif_tepe

Untitled

May 4th, 2025
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6.  
  7. int main() {
  8.     int n;
  9.     cin >> n;
  10.    
  11.     vector<int> v;
  12.     for(int i = 0; i < n; i++) {
  13.         int x;
  14.         cin >> x;
  15.        
  16.         v.push_back(x);
  17.     }
  18.     sort(v.rbegin(), v.rend());
  19.    
  20.     for(int i = 0; i < v.size(); i++) {
  21.         cout << v[i] << " ";
  22.     }
  23.    
  24.    
  25.     return 0;
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement