运行 ❯
获取
您自己的
网站
×
更改方向
更改主题,深色/浅色
转到 Spaces
#include <iostream> #include <map> using namespace std; int main() { map<string, int> people = { {"John", 32}, {"Adele", 45}, {"Bo", 29} }; // Trying to add two elements with equal keys people.insert({"Jenny", 22}); people.insert({"Jenny", 30}); cout << "Jenny is: " << people.at("Jenny") << "\n"; return 0; }
Jenny 为:22