fork download
  1. #include <stdio.h>
  2. int foo(int x, int y, int q)
  3. { if ((x<=0) || (y<=0)) return q;
  4. if (x<=1) return foo(x, y+q, q);
  5. if (y<=2) return foo(x+q, y, q);
  6. return foo(x, y-q, q) + foo(x-q, y, q); }
  7. int main( )
  8. { int r = foo(12, 9, 7);
  9. printf("%d", r);
  10. return 0;}
  11.  
Success #stdin #stdout 0.74s 5284KB
stdin
Standard input is empty
stdout
21