题意:排序后字符串全排列
思路:好久没水一题了
#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int MAXN = 220; char str[MAXN]; int main() { while (scanf("%s", str) != EOF) { int n = strlen(str); sort(str, str+n); printf("%s\n", str); while (next_permutation(str, str+n)) printf("%s\n", str); } return 0; }
POJ - 1731 Orders,布布扣,bubuko.com
原文地址:http://blog.csdn.net/u011345136/article/details/36174557