#include
using namespace std;
int C(int m, int n) {
if ((m==0)||(n==m)) return 1;
else return C(m,n-1)+C(m-1,n-1);
}
int main() {
int a, b;
cin >> a >> b;
cout << "C(" << b << "," << a << ") = " << C(a,b);<br> system("pause");
return(0);
}
Пример:
5 10
C(10,5) = 252