您的位置:首页 > 其它

uva10098 Generating Fast, Sorted Permutation

2013-07-20 20:19 417 查看

uva10098 Generating Fast, Sorted Permutation

全排列水题

#include <algorithm>
using namespace std;
#include <stdio.h>
#include <string.h>

int t;
int i;
char sb[25];
int main()
{
scanf("%d", &t);
getchar();
while (t --)
{
gets(sb);
sort(sb, sb + strlen(sb));
printf("%s\n", sb);
while(next_permutation(sb, sb + strlen(sb)))
{
printf("%s\n", sb);
}
printf("\n");
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ACM UVA