View Code of Problem 54

#include<stdio.h>
int main()
{
	long i,a[10],k=0,j;
	scanf("%ld",&i);
	while(i!=0)
	{
		a[k++]=i%10;
		i/=10;
	}
	for(j=k-1;j>0;j--)
		printf("%d ",a[j]);
	printf("%d",a[0]);
	return 0;
}

Double click to view unformatted code.


Back to problem 54