I need help, whats wrong with this

Ok so it works everywhere but MY coding platform. So how do I fix that??
cpp.sh/2ipex

Enter the trifecta
Enter a number
69
enter another number
666
one more
420
You lose . . .

Now on that link it doesnt let you win . . .
Last edited on
closed account (E0p9LyTq)
Visual Studio 2017 it works fine:
Enter the trifecta
Enter a number
5
enter another number
5
one more
5
You Died ^@^

Code::Blocks is also without problems:
Enter the trifecta
Enter a number
12
enter another number
15
one more
27
You Died ^@^

Maybe the data-sets you enter are in error.
Last edited on
Also works at cpp.sh

http://cpp.sh/9xfly

which compiler and version are you using?
Is it possible the code posted here does not match what you have in your compiler?

for example to always get you win...
if (trifecta = 1155) { cout<< "You Win!! ^-^" <<endl; }

With only one = symbol you will always win.
go to http://cpp.sh and paste your code in there

post us a link so we can see it.
closed account (E0p9LyTq)
Line 15, trifecta == a + s + b; is wrong. It should be trifecta = a + s + b;.

What you originally posted here (it was rude to delete your code from your post) is not the code you used at cpp.sh.
Hi ICU2, just to let you know, you don't need to edit your first post to communicate something new. Just click on the reply button and add more. We love hearing from you! :)
you have used (==) instead of (=) for assining value to trifecta.
So it will check if sum of a,s,b is equal to the value stored in trifecta.If it not equal so it will store 0 because 0 represent as false condition.
Thats why it giving answer diffrnt than you expcted.
Hmm ok ill edit it now and try again but i think my codeblocks is buggy ¬~¬
Topic archived. No new replies allowed.