#include #include using namespace std; int main( ) { map weight; string word; map::const_iterator it; weight["Michael"] = 60; weight["Doug"] = 58; // Michael goes on a diet: weight["Michael"] -= 2; cout << "Doug's weight: " << weight["Doug"] << "kg" << endl; cout << "Michael's weight: " << weight["Michael"] << "kg" << endl; cout << weight["Jacob"] << endl; cout << "Please type a word: "; cin >> word; ++weight[word]; cout << "Please type a word: "; cin >> word; ++weight[word]; for (it = weight.begin(); it != weight.end(); ++it) { cout << it->first << " " << it->second << endl; } return 0; }