Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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