#include <stdio.h>

/* 階乗を求める再帰関数 */
int fact(int n)
{
    if(n == 0 || n == 1)
        return 1;

    return n * fact(n - 1);
}

/* 組み合わせ nCr を求める関数 */
int comb(int n, int r)
{
    return fact(n) / (fact(r) * fact(n - r));
}

int main(void)
{
    printf("5C2 = %d\n", comb(5, 2));
    printf("6C3 = %d\n", comb(6, 3));
    printf("7C4 = %d\n", comb(7, 4));

    return 0;
}
