fork download
  1. #include <stdio.h>
  2.  
  3. int combination(int n,int r){
  4. if (n==r+1) return ;
  5. else {
  6. return (n/r)*combination(n-1,r-1);
  7. }
  8. }
  9.  
  10. int main(void) {
  11. int n,r;
  12. scanf("%d %d",&n,&r);
  13. printf("%d",combination(n,r));
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 5280KB
stdin
6 3
stdout
Standard output is empty