摘要:
题意:给出一字符串,求出所有按字母顺序排序的全排列。思路:STL库函数-next_permutation(),全排列函数。题目链接:http://poj.org/problem?id=1256View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <cmath> 4 #include <string> 5 #include <algorithm> 6 #include <iostream> 7 using namespace std; 8 const in 阅读全文
摘要:
// 若使用next_permutation函数,必须先将原序列排序! // 另外,库中另一函数prev_permutation与next_permutation相反,由原排列得到字典序中上一次最近排列。 #include <cstdio>#include <cstring>#include <cstdlib>#include <cmath>#include <string>#include <algorithm>#include <iostream>using namespace std;const int 阅读全文