#include using namespace std; const char PAPER {'p'}, SCISSORS {'s'}, ROCK {'r'}; int main() { char player1{'x'}, player2{'x'}; bool player1Good{false}; bool player2Good{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 ('p' == player1 or 's' == player1 or 'r' == player1) { player1Good = true; } else { cout << "Player 1 gave bad input" << endl; } if ('p' == player2 or 's' == player2 or 'r' == player2) { player2Good = true; } else { cout << "Player 2 gave bad input" << endl; } if (not player1Good or not player2Good) { cout << "The input is bad " << endl; } else if (player1 == player2) { cout << "Tie" << endl; } else if (PAPER == player1) { if (SCISSORS == player2) { cout << "Player2 Wins" << endl; } else { cout << "Player1 Wins" << endl; } } else if (SCISSORS == player1) { if (ROCK == player2) { cout << "Player2 Wins" << endl; } else { cout << "Player1 Wins" << endl; } } else if (ROCK == player1) { if (PAPER == player2) { cout << "Player2 Wins" << endl; } else { cout << "Player1 Wins" << endl; } } return 0; }