#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; char a[210]; int main() { while(scanf("%s",a)!=EOF) { int len = strlen(a); sort(a, a+len); cout << a << endl; int k = 1; while(next_permutation(a, a+len)) { cout << a << endl; k++; // cout << k << endl; } cout << k << endl; } string str; cin >> str; sort(str.begin(),str.end()); cout << str << endl; while (next_permutation(str.begin(), str.end())) cout << str << endl; return 0; }
时间: 2024-10-06 09:50:07