#include #include #include using namespace std; int main() { string s; map m; while( cin >> s ) { m[s]++; } m["goat"] = 12; pair p; p.first = "goat"; p.second = 14; pair::iterator,bool> insertionResult = m.insert( p ); if( insertionResult.second ) cout << "It was new" << endl; else cout << "It was already there" << endl; map::iterator it = m.begin(); while( it != m.end() ) { cout << (*it).first << "\t" << (*it).second << endl; ++it; } return 0; }