摘要:
基础数据类型所占字节数: ishort int:2 int:4 long:8 float:4 double:8 char:1 阅读全文
posted @ 2019-12-29 15:03
西西嘛呦
阅读(174)
评论(0)
推荐(0)
摘要:
set_intersection:求两个容器的交集 set_union:求两个集合的并集 set_difference:求两个集合的差集 1.set_intersection #include<iostream> using namespace std; #include <vector> #inc 阅读全文
posted @ 2019-12-29 13:28
西西嘛呦
阅读(852)
评论(0)
推荐(0)
摘要:
accumulate:计算容器元素累计总和 fill:向容器中添加元素 1.accumulate #include<iostream> using namespace std; #include <vector> #include <numeric> //常用算术生成算法 void test01() 阅读全文
posted @ 2019-12-29 13:24
西西嘛呦
阅读(211)
评论(0)
推荐(0)
摘要:
copy:容器中指定元素拷贝到另一容器中 replace:将容器内指定范围内的旧元素改为新元素 replace_if:容器内指定范围为满足条件的元素替换为新元素 swap:互换两个容器的元素 1.copy #include<iostream> using namespace std; #includ 阅读全文
posted @ 2019-12-29 13:21
西西嘛呦
阅读(294)
评论(0)
推荐(0)
摘要:
sort:对容器元素进行排序 random_shuffle:洗牌,指定范围内的元素随机调整次序 merge:容器元素合并,并存储到另一容器中 reverse:反转指定范围内的元素 1.sort #include<iostream> using namespace std; #include <alg 阅读全文
posted @ 2019-12-29 13:17
西西嘛呦
阅读(509)
评论(0)
推荐(0)
摘要:
引入#include<algorithm> 算法简介: find:查找元素 find_if:按条件查找 adjacent_find:查找相邻房重复的元素 binary_search:二分查找 count:统计元素个数 count_if:按条件统计元素个数 1.find #include<iostre 阅读全文
posted @ 2019-12-29 13:12
西西嘛呦
阅读(844)
评论(0)
推荐(0)
摘要:
需要引入头文件#include<algorithm> 1.for_each #include<iostream> using namespace std; #include <vector> #include <algorithm> class MyPrint { public: void oper 阅读全文
posted @ 2019-12-29 13:02
西西嘛呦
阅读(482)
评论(0)
推荐(0)