fork(1) download
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int i, x;
  5. char str[9];
  6.  
  7. while((x = scanf("%d", &x)) != 0)
  8. {
  9. i = 0;
  10. str[i++] = x % 2;
  11. while(x/2)
  12. {
  13. x /=2;
  14. str[i++] = x % 2;
  15. }
  16.  
  17. while(i--)
  18. {
  19. printf("%d ", str[i]);
  20. }
  21. printf("\n");
  22. }
  23.  
  24. return 0;
  25. }
  26.  
  27.  
  28.  
Internal error #stdin #stdout 0s 2116KB
stdin
97
98
99
100
0
stdout
Standard output is empty