#include<stdio.h> int main(){ int x; int t,ct=0; char a[100]; scanf("%d",&x); t=x; while(t!=0){ t=t/10; ct++; } for(int i=0;i<ct;i++){ a[i]=x%10; x=x/10; } for(int j=ct-1;j>=0;j--){ if(j!=0) printf("%d ",a[j]); else printf("%d",a[j]); } } |
Double click to view unformatted code.