void fun(char *str,int begin,int end)
{
if(begin==end){
cout<<str<<endl;
return ;
}
for(int i=begin;i<=end;++i){
if(i!=begin)
swap(str[begin],str[i]);
fun(str,begin+1,end);
if(i!=begin)
swap(str[begin],str[i]);
}
}
字符串的排列
最新推荐文章于 2018-11-14 14:08:41 发布