码迷,mamicode.com
首页 > 编程语言 > 详细

小代码 map1导入map2 c++

时间:2016-07-24 07:11:49      阅读:301      评论:0      收藏:0      [点我收藏+]

标签:小代码

 #include <iostream>
#include <map>
#include <string>
using namespace std;

int main()
{
	map<string,string> ma;
	map<string,string> mb;
	ma["01"] = "wz";
	ma["02"] = "sust";
	map<string,string>::iterator it = ma.begin();
	for(;it != ma.end();++it)
	{
		cout<<it->first<<" "<<it->second<<endl;
		mb[it->first] = it->second;
	}

	map<string,string>::iterator it2 = mb.begin();
	for(;it2 != mb.end();++it2)
	{
		cout<<it2->first<<" "<<it2->second<<endl;
	}
	return 0;
}


小代码 map1导入map2 c++

标签:小代码

原文地址:http://wzsts.blog.51cto.com/10251779/1829184

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!