fork download
  1. #include <stdio.h>
  2. int path (int x, int y){
  3. if (x==0||y==0)
  4. {
  5. return 1;
  6. }
  7. else if(x==0&&y==0){
  8. return 0;}
  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
3
2
stdout
10