用到STL里的
next_permutation(&a[0],&a[le])//说明a[0]->a[le-1]是自由排列的
View Code
#include<iostream>
#include
<string.h>
#include
<algorithm>
using namespace std;

bool cmp(char a,char b)
{
return a<b;
}

int main()
{
char a[209];
while(gets(a))
{
int le=strlen(a);
sort(
&a[0],&a[le],cmp);
do{
puts(a);
}
while (next_permutation(&a[0],&a[le]));//说明a[0]->a[le-1]是自由排列的
}
return 0;
}

相关文章:

  • 2022-12-23
  • 2021-11-13
  • 2021-12-13
  • 2021-10-08
  • 2022-12-23
  • 2022-01-26
  • 2021-11-18
猜你喜欢
  • 2022-12-23
  • 2021-11-18
  • 2021-08-28
  • 2021-12-22
  • 2021-07-05
  • 2021-12-05
  • 2022-12-23
相关资源
相似解决方案