View Code of Problem 54

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

Double click to view unformatted code.


Back to problem 54