#include #include #include // for cout #include // for setprecision #include // for ostringstream using namespace std; int main() { map gpa; // Try multimap pair p("Jack", 3.998); gpa.insert(p); p.first = "Wim"; p.second = 4.20; gpa.insert(p); // Wim Bohm p.first = "Ross"; p.second = 3.92; gpa.insert(p); // Ross Beveridge gpa.insert(make_pair("Darrell", 2.0)); // Some poor dope gpa.insert({"Ross", 3.87}); // Ross McConnell for (auto it=gpa.begin(); it!=gpa.end(); ++it) cout << it->first << " has a GPA of " << it->second << '\n'; // Now display the map with a for-each loop }