View Code of Problem 54

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

Double click to view unformatted code.


Back to problem 54