(C++) If - Else if statements for a CommandLine rock paper scissors game -


I'm quite new to C ++ but I'm reading a lot of documents and I do not know what's here Used to be. If I have made statements on other things, but maybe this is just a brain fart, I really do not know when I type "1" when he asks for input and I enter and it goes straight to the Else statement


  #include & lt; Cstdlib & gt; # Include & lt; Iostream & gt; # Include & lt; Sstream & gt; #include & lt; String & gt; using namespace std; Int main () {four choices; Int P2 = 2; Int R1 = 1; Int s3 = 3; // question cout & lt; & Lt; "Let's Rock Paper Scissors" and Lieutenant; & Lt; Andal; Cout & lt; & Lt; "(Use Letter) Rock (1) - Paper (2) - Scissors (3)" & lt; & Lt; Endl; Que: cout & lt; & Lt; "What is your choice ?:"; Cin & gt; & Gt; the option; If (like == p1) {cout & lt; & Lt; "You choose rock" & lt; & Lt; Endl;} and if (like == p2) {cout & lt; & Lt; "You choose paper" & lt; & Lt; Endl;} and if (like == s3) {cout & lt; & Lt; "Choose the scissors" & lt; & Lt; Endl;} and Goto Koo; System ("pause"); }    

You're trying to compare char There is a int , which is not going to work, how do you want to do it, replace likes to int . <

.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -