next_permutation() :
全排列函数 1.使用前应对用sort()
进行排序,得到最小排列。 2.排列是在排序后的最小排列的基础上进行操作。比如1,2,3,只会排列5次+最小排列,共计6次。 3. (a+m,a+n)
指从数组下表为m到n-1的数进行全排列。
#include
#include
using namespace std;
int main()
{
int a[4]= {1,2,3,4};
while(next_permutation(a,a+4))
{
for(int i=0; i
关注
打赏