博客
关于我
STL pair
阅读量:359 次
发布时间:2019-03-04

本文共 833 字,大约阅读时间需要 2 分钟。

 

 

#include
#include
#include
using namespace std;int main(){ pair
p; p.first="haha"; p.second=5; //或者pair
p("haha",5); cout<
<<" "<
<
("haha",5) //法二:make_pair("haha",5); p=make_pair("xixi",55); cout<
<<" "<
<
("heihei",5); cout<
<<" "<
<
,>= //先以first的大小作为标准,相等时判断second的大小 pair
p1(5,10); pair
p2(5,15); pair
p3(10,5); if(p1

 

#include
#include
#include
using namespace std;int main(){ pair
p; p.first="haha"; p.second=5; //或者pair
p("haha",5); cout<
<<" "<
<
("haha",5) //法二:make_pair("haha",5); p=make_pair("xixi",55); cout<
<<" "<
<
("heihei",5); cout<
<<" "<
<
,>= //先以first的大小作为标准,相等时判断second的大小 pair
p1(5,10); pair
p2(5,15); pair
p3(10,5); if(p1

结果: 

 

 

转载地址:http://ncfr.baihongyu.com/

你可能感兴趣的文章
mysql中出现Incorrect DECIMAL value: '0' for column '' at row -1错误解决方案
查看>>
mysql中出现Unit mysql.service could not be found 的解决方法
查看>>
mysql中出现update-alternatives: 错误: 候选项路径 /etc/mysql/mysql.cnf 不存在 dpkg: 处理软件包 mysql-server-8.0的解决方法(全)
查看>>
Mysql中各类锁的机制图文详细解析(全)
查看>>