Advertisement
Josif_tepe

Untitled

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