#include<string>
#include<cstdio>
#include<iostream>
using namespace std;
void pr(string str, int num)
{
if (num == str.size() - 1)
{
cout << str << endl;
return;
}
else
{
for (auto i = num; i < str.size(); i++)
{
swap(str[num], str[i]);
pr(str, num+1);
}
}
return ;
}
int main() {
string str;
getline(cin, str);
pr(str, 0);
system("pause");
return 0;
}
最后
以上就是单薄毛衣最近收集整理的关于c++字符串全排列的全部内容,更多相关c++字符串全排列内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复