Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <map>
- #include <string>
- using namespace std;
- int main()
- {
- string s;
- getline(cin, s);
- map<char, int> dict;
- for (int i = 0; i < s.size(); ++i) {
- if (s[i] != ' ') {
- ++dict[s[i]];
- }
- }
- for (auto el: dict) {
- if (el.second > 1)
- cout << el.first << ' ';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment