stl map

遍历map

it->first   it->second

#include<map>
#include<string>
#include<iostream>

int main()
{
map<string,int> words;
map<string,int>::iterator it=words.begin();
for(;it!=words.end();++it)
     cout<<"key:"<<it->first
         <<"value:"<<it->second<<end1;
return 0;
}

 word.erase(key) // 删除key

posted @ 2015-12-30 06:48  飞飞喵  阅读(109)  评论(0编辑  收藏  举报