c++11中的for简化用法

1、序列for循环

map<string,int> m{{"a",1},{"b",2},{"c",3}}

for(auto p:m)

{

cout<<p.first<<":"<<p.second<<endl

}

posted @ 2016-12-08 10:42  卖雨伞的小男孩  阅读(558)  评论(0编辑  收藏  举报