fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int i, n, j, tym;
  7. cin>>n;
  8. j=n;
  9. int tab[n];
  10.  
  11. for(i=0;i<n;i++)
  12. {
  13. cin>>tab[i];
  14. }
  15. cout<<'\n';
  16. sort(tab, tab+n);
  17. for(i=0;i<n;i++)
  18. {
  19. cout<<tab[i]<<" ";
  20. }
  21.  
  22. return 0;
  23. }
Success #stdin #stdout 0.01s 5504KB
stdin
4
5 4 8 1
stdout
1 4 5 8