map使用示例
#include<map>
#include<iostream>
#include <string>
using namespace std;
map<int,string>m;
int main(){
m[1]="111";
m[2]="222";
map<int,string>::iterator m_i;
m_i=m.find(1);
if(m_i!=m.end()){
cout<<m_i->second<<endl;
cout<<m[1]<<endl;
}
m.erase(m_i);
m_i=m.find(1);
if(m_i==m.end()){
cout<<"没找到\n";
}
return 0;
}


浙公网安备 33010602011771号