fork 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 + 7U) / 8U;
  13. printf("We need %u eights to reach %d\n", count, something);
  14. }
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 10320KB
stdin
Standard input is empty
stdout
We need 268435456 eights to reach 2147483646