المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Help not sure why.



C++ Programming
03-29-2009, 10:50 PM
Hello,

I have a combination algorithm I am trying to solve.

I have the formula and have got that to work if I didn't want the individual elements. However when I am trying to get to the individual elements, and I am having a problem. This is what I have so far. I know its not funny but the following works when I have to select 1 out of 2. However I get one extra count when I go and select 2 out of 3.
thanks a million in advance for helping .



////////////////// n!/(n-k)!(k!) ///////////////
k= 2;
n=3;
y=0;
i=n-k;
Total = 0;
for (y=0; y