#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
int main() {
int n;
cin >> n;
char str[100];
while (n--) {
memset(str,0,sizeof(str));
cin >> str;
int len = strlen(str);
sort(str,str+len);
cout << str << endl;
while (next_permutation(str, str + len))
cout << str << endl;
cout << endl;
}
return 0;
}
uva10098(简单题)-全排列
最新推荐文章于 2019-07-22 08:14:04 发布