uva10098 Generating Fast, Sorted Permutation

来源:互联网 发布:ipad版淘宝怎么开店 编辑:程序博客网 时间:2024/06/06 20:43

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;}


原创粉丝点击