fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4.  
  5. int main() {
  6. // your code goes here
  7. ll n;
  8. cin >> n;
  9. vector<int> v1(n);
  10. for(ll i=0;i<n;i++){
  11. cin >> v1[i];
  12. }
  13. sort(v1.begin(),v1.end());
  14.  
  15. for(ll i=0;i<n;i++){
  16. cout << v1[i] << " ";
  17. }
  18. return 0;
  19. }
Success #stdin #stdout 0.01s 5516KB
stdin
4
3 2 1 2
stdout
1 2 2 3