fork download
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int a,i,b=0,data[20];
  5. scanf("%d",&a);
  6. for(i=0;i<20;i++){
  7. data[i]=a%2;
  8. a=a/2;
  9. b=b+1;
  10. if(a==0)break;
  11. }
  12. for(i=b;i>0;i--){
  13. printf("%d ",data[i-1]);
  14. }
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 5308KB
stdin
Standard input is empty
stdout
0