pair对组创建
功能描述:
-
成对出现的数据,利用可以返回两个数据
两种创建方式
第一个数据 first 第二个数据second
#include<iostream>
#include<string>
using namespace std;
int main()
{
pair<string,int>a("魈",6); //只能2个 3个红
cout << a.first << "的核心命坐为" << a.second <<"命" << endl;
pair<string, int>b;
b = make_pair("雷电将军",2);
cout << b.first << "的核心命坐为" << b.second << "命" << endl;
system("pause");
return 0;
}