poj1731有重复字符的全排列 STL实现

l#include <stdio.h>
#include
#include
#include
#include
using namespace std;
int main()
{
string s;
cin>>s;
sort(s.begin(),s.end());//排序让字符串字典序 下面函数一般是字典序全排列
do{
cout<<s<<endl;
}
while(next_permutation(s.begin(),s.end()));//输出下一个排列的函数(有标记功能)

return 0;

}

猜你喜欢

转载自blog.csdn.net/weixin_42424319/article/details/89141924