Advertisement
Lucky134Lucky

Untitled

Feb 20th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <iostream>
  2. #include <map>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. map <char, int> box;
  8.  
  9. char stroka[100];
  10. cin.getline(stroka, 100);
  11.  
  12. int l = 0;
  13. while (stroka) {
  14.  
  15. box[stroka[l]]++;
  16.  
  17. l++;
  18. }
  19.  
  20.  
  21.  
  22. for(map<char,int>::iterator it =box.begin();it !=box.end();it++)
  23. {
  24. cout << it->first << " : " << it->second << endl;
  25. }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement