📅  最后修改于: 2022-03-11 14:44:45.443000             🧑  作者: Mango
std::map m;
std::vector key, value;
for(std::map::iterator it = m.begin(); it != m.end(); ++it) {
key.push_back(it->first);
value.push_back(it->second);
std::cout << "Key: " << it->first << std::endl();
std::cout << "Value: " << it->second << std::endl();
}