博学笃志, 切问近思!
我把九楼仁兄的程序加了点,不知对不对,请帮看看,我也初学
#include "stdio.h"
int main(void)
{
long int n=0,t=0;
int i=0;
printf("input a integer number no bigger than 99999:\n");
while(1)
{
scanf("%ld",&n);
if(n<99999)
{
break;
}
printf("the number you input is too big,please imput again!\n");
}
t=n;
for(i=0;n!=0;i++)
n/=10;
printf("位数是\n\n\n%d\n\n",i);
/*求位数结束*/
n=t;
for(i=0;n!=0;i++)/*p这是逆序的*/
{
printf("%d ",n%10);
n/=10;
}
/*自己用数组搞个顺序的吧。*/
}