Code:cout << i << " " << j << " " << number-(i+j) << endl;
Code:cout << i << " " << j << " " << number-(i+j) << endl;
Last edited by spydoor; 03-17-2005 at 02:14 PM.
Great, thanks. It gives me every possible prime number combination now I just have to figure out to get only one. Thanks for your help.
For example I let it compute 346
I only want the first answer that it computes. Is there anyway to do that?
Last edited by StarOrbs; 03-17-2005 at 02:59 PM.
Nevermind I figured it out. Thanks a lot everyone!
Dang, I finally get that one working and my sum of two primes doesn't work. Is there anyway to change the sum of three primes function to calculate the sum of two primes?
Sure. Just take out one level of the nested loops, i.e. loop from 1 to i, and for each prime 'i' you loop from 1 to (num - i), checking if (num - i) is prime.
Just Google It. √
(\ /)
( . .)
c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.