Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <set>
- using namespace std;
- int main()
- {
- string str, res = "";
- set<char> s;
- cin >> str;
- for (int i = 0; i < str.size(); i++)
- if (s.find(str[i]) == s.end())
- {
- s.insert(str[i]);
- res += str[i];
- }
- cout << res << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement