#include #include #include //for class string #include //for class vector #include //for class map using namespace std; int main() { map> m { {"New York", {"Albany", "Yonkers", "New York"}}, {"New Jersey", {"Trenton, Fort Lee", "Newark"}}, {"Connecticut", {"New Haven", "Stamford"}} }; //The expression m["New York"] is New York's vector of cities. //This vector already exists. cout << "New York has " << m["New York"].size() << " cities.\n"; //The expression m["Pennsylvania"] creates an empty //vector of cities for Pennsylvania. cout << "Pennsylvania has " << m["Pennsylvania"].size() << " cities.\n\n"; //for all the pairs in the map for (const auto& p: m) { cout << p.first << ": "; //for all the strings in the city's vector for (const string& city: p.second) { cout << city << " "; } cout << "\n"; } return EXIT_SUCCESS; }