The_Law

Untitled

Jan 24th, 2019
377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <map>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     string s;
  10.     getline(cin, s);
  11.     map<char, int> dict;
  12.  
  13.     for (int i = 0; i < s.size(); ++i) {
  14.         if (s[i] != ' ') {
  15.             ++dict[s[i]];
  16.         }
  17.     }
  18.  
  19.     for (auto el: dict) {
  20.         if (el.second > 1)
  21.             cout << el.first << ' ';
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment