标签:stream c++ alt tar pre include style pac clu
1.函数原型为:
#include <algorithm>
bool next_permutation(iterator start,iterator end)
2.用法
(1):需要将要数字按照升序排列
(2):使用方法:
#include<cstdio> #include<iostream> #include<algorithm> using namespace std; int main(){ int a[3]={1,2,3}; do{ cout<<a[0]<<a[1]<<a[2]<<endl; }while(next_permutation(a,a+3)); return 0; }
运行结果:
标签:stream c++ alt tar pre include style pac clu
原文地址:https://www.cnblogs.com/miao-xixixi/p/13018796.html