fork(2) download
  1. #include <stdio.h>
  2.  
  3. f(double n){return n>1?1+f(log(n)):0;}
  4.  
  5. int main(void) {
  6. int n;
  7. while (scanf("%d", &n) == 1)
  8. printf("f(%d) = %d\n", n, f(n));
  9. return 0;
  10. }
  11.  
Success #stdin #stdout 0s 2116KB
stdin
0 1 2 3 4 15 16 3814279 3814280
stdout
f(0) = 0
f(1) = 0
f(2) = 1
f(3) = 2
f(4) = 2
f(15) = 2
f(16) = 3
f(3814279) = 3
f(3814280) = 4