int main(int argc, char** argv)
{
pair <string,double> product1 ("Apple",6.67);
pair <string,double> product2;
pair <string,double> product3;
product2.first ="red"; // type of first is string
product2.second =0.923; // type of second is double
product3 = make_pair ("shoes",20.0);
cout <<"The price of "<< product1.first <<" is $"<< product1.second <<"\n";
return 0;
}
c++ pair
最新推荐文章于 2022-12-20 09:27:50 发布