![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
#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; }