![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c++心得体会
白衣青衫湿
这个作者很懒,什么都没留下…
展开
-
set的交换,赋值以及初始化
#include<iostream> #include<set> using namespace std; struct dian{ int x,y; /*bool operator<(const dian &a) const { return x<a.x; }*/ }; /* 自定义排序函数一定要用const*/ bool operator...原创 2019-11-26 22:22:14 · 685 阅读 · 0 评论 -
map的赋值,交换以及初始化
#include<iostream> #include<map> using namespace std; struct dian{ int x,y; /*bool operator<(const dian &a) const { return a.x>x; }*/ /*自定义类型,使用带排序效果的容器需要提前自己写好排序函数*/ }; ...原创 2019-11-26 22:14:02 · 363 阅读 · 0 评论 -
queue的交换,赋值以及初始化
#include<iostream> #include<queue> using namespace std; struct dian{ int x; int y; }; /* 为了说明queue里面的数据类型可以通用,随便定义了一个结构体*/ void print(queue<dian> &q) { while(!q.empty()) { ...原创 2019-11-26 21:54:37 · 1794 阅读 · 0 评论