Advertisement
sherry_ahmos

Untitled

May 5th, 2022
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. #include <iostream>
  2. #include <sstream>
  3. #include <cstdlib>
  4. #include <algorithm>
  5. #include <cmath>
  6. #include <iomanip>
  7. #include <numeric>
  8. #include <vector>
  9. #include <string>
  10. #include <set>
  11. #include <map>
  12.  
  13. using namespace std;
  14. #define ll long long
  15. void sherry()
  16. {
  17.     ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  18. #ifndef ONLINE_JUDGE
  19.     freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
  20. #endif
  21. }
  22. bool comp(pair<int, int> a, pair<int, int> b)
  23. {
  24.     return a.second < b.second;
  25. }
  26. int main()
  27. {
  28.     sherry();
  29.     string s;
  30.     map<char, int> m;
  31.     cin >> s;
  32.     for (ll i = 0; i < s.size(); i++)
  33.     {
  34.         m[s[i]]++;
  35.     }
  36.     for (ll i = 0; i < s.size(); i++)
  37.     {
  38.         if (m[s[i]] % 2 == 1)
  39.         {
  40.             cout << s[i];
  41.             m[s[i]] = 0;
  42.         }
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement