type
status
date
slug
summary
tags
category
icon
password
reverse()逆置
函数:
reverse(起始地址, 末尾地址);
multiset<>
带find的set,小根堆
unique()去重
函数:
unique(起始地址, 末尾地址, name);
unique函数去重并不是真正的去重,它是不断的将后面不重复的元素覆盖前面重复的元素,最后返回最后一个不重复的元素的地址。
to_string()转字符串
to_string()
:可将整形转化为字符串,不推荐将浮点型转化为字符串next_permutation()全排列
next_permutation(a+1,a+1+9);
每执行一次按字典顺序排列一次元素。strcmp()字符串大小比较
比较两个字符串,大于返回大于0的值
swap()交换
substr()截取字符串
从a截到b,或从a截到末尾。
insert()插入字符串
partial_sum()序列部分和
计算某个序列局部元素的和
itao()数字转字符
strupr()小写转大写
rotate()旋转序列
fixed 标识符,将双精浮点数转化为非科学计数法输出用
cout<<fixed<<x;
setprecision()控制有效数字位数
求交集的函数
set_intersection( )
求集合差的函数
set_difference( )
合并两个集合的函数
set_union( )
sort(size.begin(),size.end(),greater<int>());
vector从大到小排序
Floor() | 不大于自变量的最大整数 |
Ceil() | 不小于自变量的最大整数 |
Round() | 四舍五入到最邻近的整数 |
- Author:Grimner
- URL:https://tangly1024.com/article/example-26
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!