Skip to content

Instantly share code, notes, and snippets.

@mike-zhang
Created November 5, 2012 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mike-zhang/4017738 to your computer and use it in GitHub Desktop.
Save mike-zhang/4017738 to your computer and use it in GitHub Desktop.
STL map test : word count
#include <map>
#include <string>
#include <iostream>
using namespace std;
int main()
{
map<string,int> dict;
string word;
while(cin>>word)
cout<<++dict[word]<<endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment