View Code of Problem 54

#include<stdio.h>
int main()
{
    long a,n=0,b[1000],i;
    scanf("%ld",&a);
    while(a>0)
    {
        b[n]=a%10;
        a=a/10;    
        n++; //统计位数
    }
    for(i=n-1;i>0;i--)
    printf("%d ",b[i]);
	 printf("%d",b[i]);
    return 0;
}

Double click to view unformatted code.


Back to problem 54