#include "stdio.h"
#include "conio.h"
/*输入5个数字,然后 倒叙输出,使用递推算法
*/
main()
{
int i=5;
void Demo(int n);
printf("请输入要转换的数字:\n");
Demo(i);
}
void Demo(n)
int n;
{
char next;
//如果n个数为1
if(n<=1){
next=getchar();
putchar(next);
}else{
next=getchar();
Demo(n-1);
putchar(next);
}}
34-输入5个数字,使用递归的算法倒叙输出
最新推荐文章于 2023-12-14 22:39:05 发布