0
点赞
收藏
分享

微信扫一扫

习题《全排列》

皮皮球场 2022-01-05 阅读 51

例题:

输入:

 输出:

 输入样例:

输出样例:

代码 :

 #include<bits/stdc++.h>
using namespace std;
int main()
{
int l;
char str[10010];
gets(str);
l=strlen(str);
do
{
cout<<str<<endl;
}while(next_permutation(str,str+l));
return 0;
}

注意点:

1、万能头文件#include<bits/stdc++.h>,包含内容很多,可以节省时间

2、全排列函数next_permutation 

举报

相关推荐

0 条评论