余寿

关注

全排列(next_permutation)

余寿

关注

阅读 141

2022-08-11


全排列。。。。


#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,p[10];
cin>>n;
for(int i=0;i<n;i++)
{
cin>>p[i];
}
sort(p,p+n);
do
{
for(int i=0;i<n;i++)
printf("%d ",p[i]);
printf("\n");
}while(next_permutation(p,p+n));
return 0;
}



相关推荐

前程有光

全排列——next_permutation

前程有光 100 0 0

窗外路过了谁

全排列函数next_permutation

窗外路过了谁 136 0 0

未定义变量

输出全排列(20分)【next_permutation】

未定义变量 105 0 0

c一段旅程c

STL函数之全排列next_permutation

c一段旅程c 171 0 0

书呆鱼

整数全排列(旋转法,next_permutation)

书呆鱼 83 0 0

小禹说财

C++——全排列函数next_permutation和prev_permutation

小禹说财 118 0 0

村里搬砖的月野兔

POJ 3187 Backward Digit Sums 全排列next_permutation

村里搬砖的月野兔 48 0 0

Android开发指南

【排列枚举】next_permutation的应用

Android开发指南 111 0 0

juneyale

HDOJ 1716 排列2(next_permutation函数)

juneyale 99 0 0

小时候是个乖乖

next_permutation函数

小时候是个乖乖 126 0 0

精彩评论(0)

0 0 举报