题意:给你一个字符串,求出所有的字典序
思路:next_permutation();
#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
char str[210],str1[210];
while(~scanf("%s",str))
{
int len=strlen(str);
sort(str,str+len);
strcpy(str1,str);
for(int i=0;i<10000000;i++)
{
printf("%s\n",str);
next_permutation(str,str+len);
if(strcmp(str,str1)==0)break;
}
}
}