fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. long long int n,a[1000000000];
  7. cin>>n;
  8.  
  9. for(auto i=0;i<n;i++){
  10. cin>>a[i];
  11. }
  12. //sort(a, a + n, greater<int>());
  13. unique(a, a + n);
  14. for(auto i=0;i<n;i++){
  15. cout << a[i]<< endl;
  16. }
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 7827456KB
stdin
5
6
6
7
8
9
stdout
6
7
8
9
9