1std::map<int, int> m;
2std::vector<int> key, value;
3for(std::map<int,int>::iterator it = m.begin(); it != m.end(); ++it) {
4 key.push_back(it->first);
5 value.push_back(it->second);
6 std::cout << "Key: " << it->first << std::endl();
7 std::cout << "Value: " << it->second << std::endl();
8}
9