对组 (不需要头文件的)
//创建对组
void test02()
{
//第一种
pair<string, int> p(string("Tom"), 100);
cout << "姓名: " << p.first << endl;
cout << "年龄:" << p.second << endl;
//第二种
pair<string, int> p2 = make_pair("Jerry", 200);
cout << "姓名: " << p2.first << endl;
cout << "年龄:" << p2.second << endl;
}
原文:https://www.cnblogs.com/lodger47/p/14714145.html