fork(1) download
  1. #include<stdio.h>
  2.  
  3. extern int p;
  4.  
  5. int f (int *x, int c) {
  6. c = c - 1;
  7. if (c==0) return 1;
  8. *x = *x + 1;
  9. return *x * f(&p,c);
  10. }
  11.  
  12. int p=5;
  13.  
  14. int main() {
  15. int res = f(&p,5);
  16. printf("%d",res);
  17. }
Success #stdin #stdout 0s 5292KB
stdin
Standard input is empty
stdout
3024