fork(1) download
  1. #include <stdio.h>
  2. int comb(int x,int y)
  3. {
  4. if(x==0||y==0)
  5. return 1;
  6. else
  7. return comb(x-1,y)+comb(x,y-1);
  8. }
  9.  
  10. int main(void) {
  11. int x,y;
  12. scanf("%d %d",&x,&y);
  13. printf("%d\n",comb(x,y));
  14.  
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0.01s 5320KB
stdin
2 2
stdout
6