logo CodeStepByStep logo

You are working on problem set: Small Problems 2B ( Pause)

mapMystery

Language/Type: C++ map collections STL

What is the output of the following code? Assume that a map displays in {key:value, key:value, ..., key:value} format.

map<string, string> map;
map["K"] = "Schwarz";
map["C"] = "Lee";
map["M"] = "Sahami";
map["M"] = "Stepp";
map.erase("Stepp");
map.erase("K");
map["J"] = "Cain";
map.erase("C, Lee");
cout << map << endl;
output
(order shuffled)

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? .

If something seems wrong with our site, please

Is there a problem? Contact us.