View Code of Problem 54

#include<stdio.h>
int main()
{
	long n;
	scanf("%d",&n);
	long x=n;
	long count=1;
	while(x>0)
	{
		count*=10;
		x/=10;
	}
	count/=10;
	while(count>0)
	{
		int t=n/count;
		printf("%d",t);
		if(count>9) printf(" ");
		n=n%count;
		count/=10;
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 54