#include"iostream"
#include"stdio.h"
#include"string.h"
#include"algorithm"
#include"stdlib.h"
using namespace std;
char s[100];
int main()
{
int t;
cin>>t;
getchar();
while(t--)
{
scanf("%s",s);
sort(s,s+strlen(s));//所有可能情况,故要先按从小到大排序
do
{
cout<<s<<endl;
}while(next_permutation(s,s+strlen(s)));
cout<<endl;//每一个输出后都有空行,不是每两个输出之间
}
return 0;
}

相关文章:

  • 2022-01-31
  • 2022-12-23
  • 2021-10-17
  • 2021-11-01
  • 2021-06-24
  • 2021-08-30
  • 2022-03-08
猜你喜欢
  • 2022-12-23
  • 2021-07-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2022-01-09
相关资源
相似解决方案