![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
STL基础
10086love10010
这个作者很懒,什么都没留下…
展开
-
vector向量容器
#include<vector> #include<iostream> #include<stdio.h> #include<algorithm> using namespace std;///自定义sort排序方法 bool Comp(const int &a,const int &b){ ///巧妙的比较大小的写法 if(a != b) return a>b;原创 2017-07-12 10:11:12 · 413 阅读 · 0 评论 -
string基本字符系列容器
#include<string> #include<iostream> #include<stdio.h> #include<algorithm> #include<sstream> using namespace std;///c++方法,将数值转换为string string convertTOString(double x){ ostringstream o; if(o <<原创 2017-07-13 16:30:54 · 158 阅读 · 0 评论 -
set集合容器
set集合容器实现了红黑树的平衡二叉树的数据结构#include<set> #include<iostream> #include<cstdio>using namespace std;///自定义比较函数myComp,重载“()”操作符 struct myComp{ bool operator()(const int &a,const int &b){ if(a != b)原创 2017-07-14 15:22:40 · 220 阅读 · 0 评论 -
multiset多重集合容器
与set容器相比允许重复键值的插入#include<set> #include<string> #include<iostream> #include<cstdio>using namespace std;int main(){ ///定义元素类型为string的多重集合对象s,当前没有任何元素 multiset<string> ms; ms.insert("abc");原创 2017-07-14 15:52:07 · 141 阅读 · 0 评论