STL中的next_permutation函数用法
来源:互联网 发布:淘宝客申请定向计划 编辑:程序博客网 时间:2024/06/08 06:20
next_permutation函数用法:用来生成下一个排列
// 程序7-2-4.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include<algorithm>using namespace std;int _tmain(int argc, _TCHAR* argv[]){int n, p[10];scanf("%d", &n);for(int i = 0; i < n; i++) scanf("%d", &p[i]);sort(p,p+n); //从下到排序,得到p的最小排列do {for(int i = 0; i < n; i++) printf("%d ", p[i]); //输出排列pprintf("\n");}while(next_permutation(p,p+n)); //求下一个排列return 0;}
0 0
- STL中的next_permutation函数用法
- 【STL】next_permutation函数用法
- STL中的全排列next_permutation函数
- 如何实现STL中的next_permutation函数?
- 【STL】 next_permutation用法
- STL的next_permutation函数
- stl全排列next_permutation()与prev_permutation()函数用法
- STL/next_permutation()和prev_permutation()函数
- 《STL源码剖析》--next_permutation函数
- POJ1256 Anagram STL中的next_permutation()
- STL中的全排列next_permutation
- stl中的next_permutation和prev_permutation
- algorithm中的next_permutation函数
- C++STL的next_permutation 的用法
- Permutations II stl next_permutation的用法
- STL库——next_permutation用法
- HDU1027(next_permutation函数用法)
- C++ STL 之 next_permutation 的用法(下一个序列函数,按字典序排)
- USACO--1.1Your Ride Is Here
- 生僻但有用的操作
- windows 32位程序编译成64位
- HDOJ--2795--Billboard【线段树】
- java求1的阶乘到10的阶乘的叠加和
- STL中的next_permutation函数用法
- Android四大基本组件介绍与生命周期
- uva 10602 - Editor Nottoobad(贪心)
- linux0.11 中断和异常
- Objective-C中的作用域静态变量详解
- 用java实现终极密码游戏
- [Python]属性和property内建函数
- hdu 1141 Factstone Benchmark
- HDU 3265 Posters (线段树-扫描线)