全排列的资料

1、利用C++中的next_permutation() 函数

#include <iostream>
#include <algorithm>
#include <string>
 
using namespace std;
 
int main()
{
    string str;
    cin >> str;
    sort(str.begin(), str.end());
    cout << str << endl;
    while (next_permutation(str.begin(), str.end()))
    {
        cout << str << endl;
    }
    return 0;
}

2、编程思路

http://blog.sina.com.cn/s/blog_70e9c0d40100xsex.html

posted @ 2013-03-18 15:01  msober  阅读(121)  评论(0)    收藏  举报