I keep getting "expected initializer before 'if'" errors I was wondering if anyone can help me with that problem?I have this homework assignment that basically asks you to run a rock paper scissors game with 2 players.
#include <iostream>
int main()
{
int x, y;
std::cout << "Player 1 enter rock(1), paper(2), scissors(3):";
std::cin >> x;
std::cout << "Player 2 enter rock(1), paper(2), scissors(3):";
std::cin >> y;
}
if ( x==1 ) and ( y==2 ) {
std::cout << "Player 2 Wins! Paper Covers Rock!!\n";
}
else if ( x==1 ) and ( y==3 ) {
std::cout << "Player 1 Wins! Rock Breaks Scissors!!\n";
}
else if ( x==1 ) and (x==1) {
std::cout << "Tie with rock!\n";
}
else if ( x==2 ) and ( y==3 ) {
std::cout << "Player 2 Wins! Scissors Cut Paper!!\n";
}
else if ( x==2 ) and ( y==1 ) {
std::cout << "Player 1 wins! Paper Covers Rock!!\n";
}
else if ( x==2 ) and ( y==2 ) {
std::cout << "Tie with Paper!\n";
}
else if ( x==3 ) and ( y==1 ) {
std::cout << "Player 2 wins! Rock Breaks Scissors!!\n";
}
else if ( x==3 ) and ( y==2 ) {
std::cout << "Player 1 wins! Scissors Cut Paper!!\n";
}
else if ( x==3 ) and ( y==3 ) {
std::cout << "Tie with Scissors!";
}
else if (x>3){
std::cout << "Invalid move!!\n";
}
else if (y>3){
std::cout << "Invalid move!!\n";
}
return 0
}
If you're trying hard to lose weight then you certainly need to jump on this totally brand new custom keto meal plan diet.
RépondreSupprimerTo create this service, licensed nutritionists, personal trainers, and cooks joined together to develop keto meal plans that are effective, suitable, economically-efficient, and delicious.
Since their launch in early 2019, thousands of clients have already completely transformed their figure and well-being with the benefits a proper keto meal plan diet can give.
Speaking of benefits; in this link, you'll discover eight scientifically-certified ones offered by the keto meal plan diet.