全排列(cpp)

Posted dysjtu1995

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了全排列(cpp)相关的知识,希望对你有一定的参考价值。

void process1(string str, int i)
    if(i == str.length())
        cout << str << endl;
    
    for(int j = i;j < str.length(); j++)
        swap(str[i], str[j]);
        process1(str, i+1);
    


void printAllPermutations1(string str)
    process1(str, 0);

以上是关于全排列(cpp)的主要内容,如果未能解决你的问题,请参考以下文章