全排列函数 next_permutation && prev-permutation
来源:互联网 发布:找字体软件 编辑:程序博客网 时间:2024/05/24 05:28
#include<iostream>#include<stdio.h>#include<string.h>using namespace std;int main(){int a[10]={1,2,3};do{ cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<endl; }while(next_permutation(a,a+3));cout<<endl<<"--------"<<endl<<endl; int aa[10]={3,2,1};do{ cout<<aa[0]<<" "<<aa[1]<<" "<<aa[2]<<endl; }while(prev_permutation(aa,aa+3)); system("pause"); return 0;}
小结:next_permutation是要在升序数组的条件下输出升序排列,prev-permutation则刚好相反
执行结果:
- 全排列函数 next_permutation && prev-permutation
- 全排列 next_permutation()函数
- 全排列函数next_permutation,prev_permutation
- 全排列函数 next_permutation()
- 【全排列】next_permutation函数 【algorithm】
- next_permutation函数(全排列)
- next_permutation函数(全排列)
- 1384 全排列 next_permutation()函数
- STL之next_permutation() 全排列函数
- hdu1027 全排列(STL函数next_permutation)
- 全排列函数 : next_permutation and prev_permutation
- 使用next_permutation函数生成全排列
- C++库 全排列函数next_permutation
- hdu 1027 全排列函数next_permutation运用
- 手链样式( 使用全排列函数next_permutation)
- STL中全排列函数 next_permutation
- 关于全排列 next_permutation() 函数的用法
- 蓝桥杯之全排列函数 next_permutation()解析
- cocos2d-x: 粒子系统 [2.0.2]
- 国外大牛们一年发7点以上SCI的诀窍[转]
- 日期格式转换
- android Multiple markers at this line - The type java.lang.Class cannot be resolved. It is indirectl
- 多个构造器参数使用构造器代替 取自effective java
- 全排列函数 next_permutation && prev-permutation
- 运行加载.ui文件
- 为什么美国互联网公司在中国市场都失败了?
- 网页右下角弹出提示框
- (转)SQL 优化原则
- eclipse装反编译插件
- 八位陌生人接力奔跑将喝农药女孩送到医院
- csdn帐号密码不幸被盗!
- 教你如何在微博上扮成“名人”