Advertisement
Josif_tepe

Untitled

Feb 12th, 2021
131
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<ctype.h>
  3. #include<cmath>
  4. #include<iomanip>
  5. #include <vector>
  6. #include <algorithm>
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11.     int n; // size of array
  12.     cin >> n;
  13.     vector<int> v(n);
  14.     for(int i = 0; i < n; i++) {
  15.         cin >> v[i];
  16.     }
  17.     sort(v.begin(), v.end());
  18.     for(int i = 0; i < n; i++) {
  19.         cout << v[i] << " ";
  20.     }
  21.     return 0;
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement