标签:style blog io os ar div sp art on
Input
Output
Sample Input
bbjd
Sample Output
bbdj bbjd bdbj bdjb bjbd bjdb dbbj dbjb djbb jbbd jbdb jdbb
函数生成排列组合序列
#include <stdio.h> #include <string.h> #include <algorithm> #include <iostream> using namespace std; int main() { char s[300]; int len; while(scanf("%s", s)!=EOF) { len = strlen(s); sort(s, s+len); do { printf("%s\n", s); }while(next_permutation(s, s+len)); } return 0; }
标签:style blog io os ar div sp art on
原文地址:http://www.cnblogs.com/yspworld/p/3989105.html