C++ map遍历方法
//迭代器版本
auto i = my_map.begin(); while(i != my_map.end()){ cout << i->first << ":" << i->second << endl; i++; }
//另一种写法
for (auto i = my_map.begin(); i != my_map.end(); ++i)
cout << i->first << ":" << i->second << endl;
//C++11新特性
for(auto i:my_map) cout << i.first << ":" << i.second <<endl;