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

浙公网安备 33010602011771号