#include“stdio.h”
void print(int n)
{
if (n > 9)
{
print(n / 10);
}
printf("%d ",n%10);
}
int main()
{
unsigned int num = 0;
scanf("%d",&num);
print(num);
return 0;
}
C语言实现依次打印每一位的数
于 2022-10-07 12:53:13 首次发布
#include“stdio.h”
void print(int n)
{
if (n > 9)
{
print(n / 10);
}
printf("%d ",n%10);
}
int main()
{
unsigned int num = 0;
scanf("%d",&num);
print(num);
return 0;
}