#include<stdio.h> #include<math.h> main() { int i,j,n,m,k,x; k=1; j=1; scanf("%d",&n); m=n; while(m/10!=0){ k++; j=j*10; m=m/10; } for(i=0;i<k;i++){ x=n/j; x=x%10; j=j/10; printf("%d ",x); } printf("\b"); } |
Double click to view unformatted code.