fork(1) download
  1. #include <iostream>
  2. #include <fstream>
  3. #include <algorithm>
  4. #include <vector>
  5.  
  6. using namespace std;
  7.  
  8. int n;
  9. vector<int> a;
  10.  
  11. int main()
  12. {
  13. fstream fin;
  14. fin.open("input.txt");
  15. fin >>n;
  16. a.reserve(n);
  17. for (int i=0; i<n; ++i) fin >> a[i];
  18. sort(a.begin(), a.end());
  19. for (int i=0; i<n; ++i) cout << a[i] <<' ';
  20. fin.close();
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
Standard output is empty