fork(8) download
  1. #include <stdio.h>
  2. int path (int x, int y){
  3. if (x<0||y<0){
  4. return 0;
  5. }
  6. if (x==0||y==0){
  7. return 1;
  8. }
  9. return path(x-1,y)+path(x,y-1);
  10. }
  11.  
  12.  
  13. int main(void) {
  14. int x,y;
  15. scanf("%d\n",&x);
  16. scanf("%d\n",&y);
  17. int path(x,y);
  18. printf("%d\n",path(x,y));
  19. // your code goes here
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 5316KB
stdin
5 5
stdout
252