閱讀801 返回首頁    go 技術社區[雲棲]


next_permutation的使用

#include <iostream>
#include <algorithm>
#include <string>

using namespace std;

int main()
{
    string s("12435");

    sort(s.begin(), s.end());
    cout << s << endl;
    
    //next_permutation的使用
    while (next_permutation(s.begin(), s.end()))
        cout << s << endl;

    cin.get();
    return 0;
}

最後更新:2017-04-02 15:15:29

  上一篇:go maven學習七之用戶密碼修改和添加用戶
  下一篇:go 揭秘APP刷榜黑幕 暴利催生的產業鏈