Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <map>
- #include <algorithm>
- using namespace std;
- int main() {
- string s;
- map<string,int>::iterator i;
- map<string, int> m;
- while(cin >> s){
- //if(s=="x")break;
- transform(s.begin(),s.end(),s.begin(),::tolower);
- ++m[s];
- }
- for(i = m.begin(); i != m.end(); ++i){
- cout << i->first << ":" << i-> second << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement