![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
STL学习
文章平均质量分 95
I_think_I_like
认认真真敲代码
展开
-
algorithm头文件常用函数
algorithm头文件下常用函数max()、min()abs()swap()reverse()next_permutation()、pre_permutation()fill()sort()lower_bound()、upper_bound()nth_element() max()、min() max(x,y),min(x,y)分别返回x和y中的最大值和最小值,必须是两个参数,这两个参数的类型可以是整数也可以是浮点数。 #include<iostream> #include<algori原创 2021-02-04 13:09:53 · 321 阅读 · 1 评论 -
C++标准库模板
C++标准库模板 Standard Template Library(STL)vector常用方法set常见用法string常见用法 vector常用方法 vector翻译为向量,或者边长数组,即长度根据需要而自动改变的数组。 1.创建vector的构造方法 #include<iostream> #include<vector> #include<cstdio> using namespace std; int main() { //创建二维向量 vect原创 2021-01-30 17:17:25 · 203 阅读 · 0 评论 -
STL_vector学习笔记1
几种创建vector的构造方法: #include<iostream> #include<vector> using namespace std; int main() { //vector构造函数 vector<int> a1; //创建一个空的vector vector<int> a2(10); //创建一个指定初始大小的vector vector<int> a3(12,3);//创建一个指定初始大小vector并赋初始值原创 2020-11-10 12:48:06 · 122 阅读 · 0 评论