Here is what I have so far:
Code:
#include <iostream>
unsigned long factorial(unsigned long n, unsigned long r); // function prototype
int main()
{
unsigned long answer, things, sets;
cout << "Please enter the number of items: " << endl;
cin >> things;
cout << "Please enter the number of sets: " << endl;
cin >> sets;
answer = factorial (things, sets);
cout << "The answer is: " << answer << endl;
return 0;
}
unsigned long factorial(unsigned long n, unsigned long r) // recursive function
{
unsigned long a, b;
while (n > 1)
{
a = n * factorial((n -1), r);
}
while (r >1)
{
b = r * factorial((r-1), n);
}
if (r <= 1 && n <= 1)
return a/( b *(a-b));
}
This will compile, but not much else.