#include <stdio.h>
int combi(int n, int r){
if (r == 0){
return 1;}
else if(n == r){
return 1;}
else if (r == 1){
return n;}
else
{return combi(n - 1, r - 1) + combi(n - 1, r);}
}
int main(void){
int n, r;
n = 4, r = 2;
printf("C(n=%d, r=%d) = %d\n", n
, r
, combi
(n
, r
)); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgY29tYmkoaW50IG4sIGludCByKXsKICAgIGlmIChyID09IDApewogICAgICAgIHJldHVybiAxO30KICAgIGVsc2UgaWYobiA9PSByKXsKICAgICAgICByZXR1cm4gMTt9CiAgICBlbHNlIGlmIChyID09IDEpewogICAgICAgIHJldHVybiBuO30KICAgIGVsc2UKICAgICAgICB7cmV0dXJuIGNvbWJpKG4gLSAxLCByIC0gMSkgKyBjb21iaShuIC0gMSwgcik7fQp9CmludCBtYWluKHZvaWQpewogICAgaW50IG4sIHI7CiAgICBuID0gNCwgciA9IDI7CiAgICBwcmludGYoIkMobj0lZCwgcj0lZCkgPSAlZFxuIiwgbiwgciwgY29tYmkobiwgcikpOwogICAgcmV0dXJuIDA7Cn0KCg==