#include <stdio.h> #include <math.h> int main() { int n,i=0,a=0; scanf("%d",&n); int temp = n; for(n;n>0;n=n/10){ i++; } n=temp; for(i;i>1;i--){ n = temp/(pow(10,i-1)); printf("%d ",n); temp = temp-pow(10, i-1)*n; n = temp; } n = temp/(pow(10,i-1)); printf("%d",n); return 0; } |
Double click to view unformatted code.