C语言习题【3】打印一个数的每一位(递归)
时间:2020-03-19 10:25:38
收藏:0
阅读:40
#include<stdio.h>
#include<math.h>
void copy(int x)
{
if (x / 10 == 0)
printf("%d", x % 10);
else
{
printf("%d ", x%10);
return copy(x / 10);
}
}
int main()
{
int x=1234;
copy(x);
return 0;
}
原文:https://blog.51cto.com/14737345/2479825
评论(0)