View Code of Problem 54

#include<stdio.h>
#include<math.h>
#include<string.h>
#include <stdlib.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;
		if(count < 10){
			printf("%d",t);
			break;
		}
			
		printf("%d ",t);
		n=n%count;
		count/=10;
	}
	return 0;
}












Double click to view unformatted code.


Back to problem 54