Advertisement
AmidamaruZXC

TaskG

Apr 24th, 2021
755
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <set>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     string str, res = "";
  10.     set<char> s;
  11.     cin >> str;
  12.     for (int i = 0; i < str.size(); i++)
  13.         if (s.find(str[i]) == s.end())
  14.         {
  15.             s.insert(str[i]);
  16.             res += str[i];
  17.         }
  18.     cout << res << endl;
  19. }
  20.  
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement