View Code of Problem 54

#include <stdio.h>
int main(){
  long n;
  scanf("%ld",&n);
  int b[100];
  int k=0,i;
  while(n/10!=0||n%10!=0){
    b[k++]=n%10;
    n=n/10;
    
  }
  for(i=k-1;i>=0;i--){
    if(i>0)
    printf("%d ",b[i]);
      else
        printf("%d",b[i]);
  }
  
  
  
  return 0;
}

Double click to view unformatted code.


Back to problem 54