next_permutation
来源:互联网 发布:汽车用品淘宝 编辑:程序博客网 时间:2024/06/02 06:27
next_permutation的函数声明:
#include<algorithm>using namespace std;
next_permutation()函数功能是输出所有比当前排列大的排列,顺序是从小到大。
而prev_permutation()函数功能是输出所有比当前排列小的排列,顺序是从大到小。
#include <iostream> #include <algorithm> #include <string> using namespace std; int main() { string str; cin >> str; sort(str.begin(),str.end()); while (next_permutation(str.begin(), str.end())) cout << str << endl; return 0; }
阅读全文
0 0
- next_permutation
- next_permutation
- next_permutation
- next_permutation
- next_permutation
- next_permutation
- next_permutation
- next_permutation
- next_permutation
- next_permutation
- next_permutation
- next_permutation
- next_permutation
- next_permutation
- next_permutation
- next_permutation
- next_permutation
- next_permutation
- 协调世界时转换为GPS周秒
- 。。。
- Linux中的文件IO
- 《Recent Advances in Convolutional Neural Networks》(一)
- 大神前端博客
- next_permutation
- vue.js移动端从一个购物车入门vuex环境搭建
- springmvc 传递复杂对象参数报 property path is neither an array nor a List nor a Map
- C语言实现堆排序算法
- java.lang.UnsatisfiedLinkError: no jacob-1.17-x64 in java.library.path
- 关于导入表
- HPU 1413: StarFarming [最短路]
- python tkinter练习小程序
- MapReduce典型编程场景——全局计数器