fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. ios_base::sync_with_stdio(false);
  7. cin.tie(0);
  8.  
  9. int n;
  10. cin >> n;
  11.  
  12. vector<int> a(n);
  13. for (int i = 0; i < n; i++)
  14. {
  15. cin >> a[i];
  16. }
  17.  
  18. sort(a.begin(), a.end());
  19.  
  20. for (int i : a)
  21. cout << i << " ";
  22. }
Success #stdin #stdout 0s 5288KB
stdin
3
2 3 8
stdout
2 3 8