c语言编程第五题求答案!!

2025-05-19 02:04:31
推荐回答(1个)
回答(1):

组合数C(m,n)吗?给你写个算法就是了:

int C(int m, int n)
{
    int result = 1;
    for (int i = 0; i < n; ++i)
        result *= m - i;
    for (int j = 1; j <= n; ++j)
        result /= j;
    return result;
}