首页 > 编程语言 > 详细

小代码 map1导入map2 c++

时间:2016-07-24 07:09:25      阅读:210      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!