pair对组
pair对组创建
功能描述:
成对出现的数据,利用对组可以返回两个数据
创建方式:
pair<type,type> p (value1,value2);
pair<type,type> p = make_pair(valu1,value2);
#include <iostream>
using namespace std;
#include <set>
/*
*/
void test01()
{
//第一种方式
pair<string,int>p1("amy",15);
cout<<p1.first<<" "<<p1.second<<endl;
//第二种方式
pair<string,int>p2=make_pair("lili",17);
cout<<p2.first<<" "<<p2.second<<endl;
}
int main()
{
test01();
return 0;
}