一、思想
递归
void test(int n)
{
if (n < 10)
{
printf("%d ", n);
}
else
{
test(n / 10);
printf("%d ", n % 10);
}
}
int main()
{
test(123456789 );
return 0;
}
运行结果
一、思想
递归
void test(int n)
{
if (n < 10)
{
printf("%d ", n);
}
else
{
test(n / 10);
printf("%d ", n % 10);
}
}
int main()
{
test(123456789 );
return 0;
}
运行结果