map最基本操作

#include<iostream>
#include<map>
using namespace std;
int main()
{
    /*map<int,char> mp;
    map<int,char>::iterator it;
    mp[2]='L';
    mp[1]='A';
    mp[3]='Z';
    for(it=mp.begin();it!=mp.end();it++)
    {
        cout<<it->first<<" "<<it->second<<endl;
    }*/
    /*map<int,string> mp1;
    map<int,string>::iterator it;
    mp1[2]="lz";
    mp1[1]="df";
    mp1[3]="kl";
    for(it=mp1.begin();it!=mp1.end();it++)
    {
        cout<<it->first<<" "<<it->second<<endl;
    }*/
}

猜你喜欢

转载自www.cnblogs.com/Leozi/p/10835065.html