fork(1) download
  1. #include <limits.h>
  2. #include <stdio.h>
  3. static int get_the_value() {
  4. int value;
  5. if (scanf("%d", &value) != 1) value = INT_MAX - 1;
  6. return value;
  7. }
  8. int main(void) {
  9. {
  10. int something = get_the_value();
  11. // How many 8s (or parts thereof) do we need?
  12. unsigned count = (something + 7) / 8;
  13. printf("We need %u eights to reach %d\n", count, something);
  14. }
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 9432KB
stdin
Standard input is empty
stdout
We need 4026531841 eights to reach 2147483646