fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n; cin >> n;
  6. vector<int> a(n);
  7. for(int i=0 ; i<n ; i++) cin >> a[i];
  8. sort(a.begin(), a.end());
  9. for(int i=0 ; i<n ; i++) cout << a[i] << " ";
  10. cout << endl;
  11. return 0;
  12. }
Success #stdin #stdout 0s 4564KB
stdin
5
3 9 1 7 4
stdout
1 3 4 7 9