#include #include #include using namespace std; int main() { map m; m["abc"] = 12; m["def"] = 33; m["abc"] = 99; m["dog"] = 6; m["abc"] = 3; cout << m["abc"] << ", " << m["dog"] << "\n"; cout << "horse appears " << m.count("horse") << " times\n"; cout << "abc appears " << m.count("abc") << " times\n"; cout << m.size() << "\n"; for (map::iterator p = m.begin(); p != m.end(); advance(p, 1)) cout << p->first << " = " << p->second << "\n"; }