Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string>
- #include <unordered_map>
- #include <iostream>
- using namespace std;
- int main()
- {
- unordered_map<string, size_t> wordcnt;
- string word;
- while(cin >> word)
- wordcnt[word]++;
- for(auto &i : wordcnt)
- cout << i.first << ": " << i.second << "\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement