View Code of Problem 54

#include<stdio.h>
//#include<string.h>
#define N 100
int main() {
	long  n;
	int a[N]= {0};
	int i=0;
	scanf("%ld",&n);
	while(n>0) {
		a[i++]=n%10;
		n/=10;
	}
	for(i-=1; i>=0; i--) {

		printf("%d",a[i]);
		if(i!=0)
			printf(" ");
	}

	printf("\n");
	return 0;
}

Double click to view unformatted code.


Back to problem 54