include <stdio.h>
void fun(int x)
{
if(x/2>0)
{
fun(x/2);
}
printf("%d",x);
}
main()
{
fun(3);
printf("\n");
}
void fun(int x)
{
if(x/2>0)
{
fun(x/2);
}
printf("%d",x);
}
main()
{
fun(3);
printf("\n");
}
x / 2 == 1 > 0 所以
fun(1): 1 / 2 == 0, 所以打印 1,退出函数
打印3,最终打印效果 13