Advertisement
eXFq7GJ1cC

Untitled

Oct 1st, 2012
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include <string>
  2. #include <unordered_map>
  3. #include <iostream>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     unordered_map<string, size_t> wordcnt;
  9.     string word;
  10.    
  11.     while(cin >> word)
  12.         wordcnt[word]++;
  13.    
  14.     for(auto &i : wordcnt)
  15.         cout << i.first << ": " << i.second << "\n";
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement