#include using namespace std; const char PAPER {'p'}, SCISSORS {'s'}, ROCK {'r'}; int main() { char player1{'x'}, player2{'x'}; bool goodInput{false}; cout << "Enter the choice for player 1 (p,s,r) =>"; cin >> player1; cout << "Enter the choice for player 2 (p,s,r) =>"; cin >> player2; cout << endl; cout << "The choices are " << player1 << " and " << player2 << endl; if (player1 == 'p' or player1 =='s' or player1 == 'r') { goodInput = true; } else { goodInput = false; cout << "Player 1 gave bad input" << endl; } if (player2 == 'p' or player2 =='s' or player2 == 'r') { goodInput = true and goodInput; } else { goodInput = false; cout << "Player 2 gave bad input" << endl; } if (goodInput) { if (player1 == player2) { cout << "It is a tie" << endl; } else { if ( PAPER == player1) { if (SCISSORS == player2) { cout << "Player 2 wins" << endl; } else { cout << "Player 1 wins" << endl; } }else { if (SCISSORS == player1) { if (PAPER == player2) { cout << "Player 1 wins" << endl; } else { cout << "Player 2 wins" << endl; } }else { if (ROCK == player1) { if (SCISSORS == player2) { cout << "Player 1 wins" << endl; } else { cout << "Player 2 wins" << endl; } } } } } } return 0; }