Advertisement
Josif_tepe

Untitled

May 18th, 2024
616
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <set>
  4. using namespace std;
  5. int main() {
  6.     int n;
  7.     cin >> n;
  8.     set<int> st;
  9.     for(int i = 0; i < n; i++) {
  10.         int x;
  11.         cin >> x;
  12.  
  13.         st.insert(x);
  14.     }
  15.  
  16.     for(int x : st) {
  17.         cout << x << " " ;
  18.     }
  19.  
  20.  
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement