fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n;
  7. cin >> n;
  8. vector<int> arr(n);
  9. set<int> sorted;
  10. for (int i = 0; i < arr.size(); i++)
  11. {
  12. cin >> arr[i];
  13. sorted.insert(arr[i]);
  14. }
  15.  
  16. for (int i : sorted)
  17. {
  18. cout << i << " ";
  19. }
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0.01s 5504KB
stdin
Standard input is empty
stdout
0