其实就是用递归代替完成for的作用
#include<stdio.h>
void show(int n)
{
int s=0;
static j=1;//j的值会变定义成static变量
s=n%(j*10)/j;//依次求出个 十 百...位上的数
printf("%d",s);//输出
j*=10;
if(j<n)//如果没到最高位则继续调用
{
show(n);
}
}
int main()
{
int n;
scanf("%d",&n);
show(n);
return 0;
}