【问题描述】
编写一个递归函数,实现将输入的任意字符串反向输出的功能。如果输入字符串:ABCD,输出字符串DCBA。
#include<stdio.h>
A()
{
char a;
scanf("%c",&a);
if(a!=’#’)
A();
if(a!=’#’)
printf("%c",a);
}
int main()
{
printf(“以字符#结束\n”);
A();
}
递归反向输出字符串
猜你喜欢
转载自blog.csdn.net/weixin_46352060/article/details/104781751
今日推荐
周排行