#include <iostream>
#include<algorithm>

using namespace std;

int main()
{
    string str;
    cin>>str;
    sort(str.begin(),str.end());
    do{
        cout<<str<<endl;
    }while(next_permutation(str.begin(),str.end()));
    return 0;
}

小结:
全排列系统函数next_permutation(排列的开始位置,排列的结束位置,排列方式(默认从小到大,可以自己修改))。

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐