fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int x,c,M;
  5. scanf("%d",&x);
  6. for(c=0;c<10;c++){
  7. M=x%2;
  8. x=x/2;
  9. if(M){
  10. printf("%d ",c);
  11. }
  12. }
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0.01s 5324KB
stdin
347
stdout
0 1 3 4 6 8