![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
qq_Xiao菜鸡
这个作者很懒,什么都没留下…
展开
-
STL之next_permutation()的使用
1.next_permutation()的函数原型 template <class BidirectionalIterator> bool next_permutation (BidirectionalIterator first, BidirectionalIterator last );2.使用方法下一个排列组合存在时,将对序列从first到last-1进行重新排列组合为...原创 2019-01-23 17:49:40 · 176 阅读 · 0 评论 -
C++使用stl对字符串排序
一个string,使用sort()函数将其按字典序排序。代码如下#include<iostream>#include<algorithm>#include<string>using namespace std;int main(){ string str; while(cin>>str){ int len = str.le...原创 2019-01-13 16:45:32 · 1048 阅读 · 0 评论 -
C++STL的两种find()函数的使用
第一种,algorithm头文件的find()。使用方法:find(begin,end,value)解释:第一个参数是容器或者数组的起始地址(容器.begin()或者数组名),也可以是任意地址,不非法即可;第二个参数是结束查找的地址(容器.end()或者数组名+长度),value是想要查找的字符或者字符串。查找成功将返回迭代器(容器)或者指针(数组),否则返回end()。第二种,string...原创 2019-01-14 18:59:32 · 2142 阅读 · 0 评论 -
同余定理进行大数求模
给出一个大数比如1234687415164641,求其对32的模。运用同余定理解决。用了以下两个同余定理公式: (A + B) mod M = ( A mod M + B mod M ) mod M (A * B) mod M...原创 2019-02-21 23:06:09 · 330 阅读 · 0 评论