POJ 1731

作者: vanadia | 来源:发表于2016-08-31 21:09 被阅读0次

POJ 1731

题意

求全排列

思路

直接调用next_premutation函数。

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

using namespace std;

int main(int argc, char const *argv[])
{
    string str;
    while(cin>>str){
        sort(str.begin(),str.end());
        cout<<str<<endl;
        while(next_permutation(str.begin(), str.end()))
            cout<<str<<endl;
    }
    return 0;
}

相关文章

  • POJ 1731

    POJ 1731 题意 求全排列 思路 直接调用next_premutation函数。

  • POJ 1731

    POJ 1731 题意 求全排列 思路 直接调用next_premutation函数。

  • 1731

    2021.12.26 星期日 晴 今天要上班,出门看看路,唉!愁啊!晚点儿再去吧。 商量云灿把她...

  • Chapter9——图——最小生成树

    1. 题目列表 POJ1789(prim算法) POJ2485(prim) POJ1258(prim) POJ30...

  • poj来自群

    OJ上的一些水题(可用来练手和增加自信) (poj3299,poj2159,poj2739,poj1083,poj...

  • Chapter5——数据结构——字符串

    1. 题目列表 poj1035,poj3080,poj1936 2. POJ1035——Spell checker...

  • ACM算法学习状态

    初期:一.基本算法:(1)枚举. (poj1753,poj2965)(2)贪心(poj1328,poj2109,p...

  • 常用技巧合集

    1.尺取法 POJ 3061 POJ3320 POJ 2739 2.反转问题 POJ 3276 集合的整数表示空集...

  • Chapter7——基础算法——哈希、二分

    1. 题目列表 POJ3349(数组hash) POJ3274(问题转换+数组hash、树状数组) POJ2151...

  • 计算几何

    极限 POJ 1981: Circle and Points POJ 1418: Viva Confetti题解链...

网友评论

      本文标题:POJ 1731

      本文链接:https://www.haomeiwen.com/subject/dckcettx.html