📄 comm.h
字号:
// determine the number of committees with k members that
// can be chosen from n persons
int comm (int n, int k)
{
// stopping condition; too few persons
if (k > n)
return 0;
// stopping condition; committee of the whole or 0 members
else if (n == k || k == 0)
return 1;
else
// recursive step: all committes without person A
// + all committees that include person A
return comm(n-1,k) + comm(n-1,k-1);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -