Advertisement
Guest User

Untitled

a guest
Apr 6th, 2020
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <map>
  4. #include <algorithm>
  5.  
  6. using namespace std;
  7.  
  8.  
  9. int main() {
  10.     string a;
  11.     getline(cin, a);
  12.     map<char, int> a1;
  13.     for (int i = 0; i < a.size(); ++i) {
  14.         ++a1[a[i]];
  15.     }
  16.     for (auto it = a1.begin(); it != a1.end(); ++it) {
  17.         cout << it->first << " : " << it->second << endl;
  18.     }
  19.  
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement