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