HZ2030819080


私信TA

用户名:H2030819080

访问量:838

签 名:

等  级
排  名 665
经  验 3895
参赛次数 23
文章发表 7
年  龄 0
在职情况 学生
学  校 贺州学院
专  业

  自我简介:

TA的其他文章

解题思路:

注意事项:

参考代码:

#include<stdio.h>

#include<string.h>

#define N 100

void  mychar(int n,int m,char ch[])

{

char s;

if(n==m&&m==0){

printf("\n");

puts(ch);

return ;}

s=*(ch+n);

*(ch+n)=*(ch+m);

*(ch+m)=s;

puts(ch);

if((n+1)>=(m-1))

{

printf("\n");

puts(ch);

return ; 

}

mychar(n+1,m-1,ch);

int main()

{

int n,l,i;

char str[N];

scanf("%d",&n);

getchar();

for(i=0;i<n;i++)

scanf("%c",&str[i]);

str[i]='\0';

    mychar(0,n-1,str);

    return 0;

}


 

0.0分

0 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区