Advertisement
AmidamaruZXC

Untitled

Oct 22nd, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <locale>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8.     string s, res = "";
  9.     int* arr = new int[255];
  10.     for (int i = 0; i < 255; i++)
  11.         arr[i] = 0;
  12.     cin >> s;
  13.     for (int i = 0; i < s.size(); i++)
  14.     {
  15.         arr[s[i]]++;
  16.         if (arr[s[i]] > 1)
  17.             res += s[i];
  18.     }
  19.     cout << res;
  20.     return 0;
  21. }
  22.  
  23.  
  24.  
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement