#include using namespace std; const char PAPER {'p'}, SCISSORS {'s'}, ROCK {'r'}; int main() { char player1{'x'}, player2{'x'}; 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 == PAPER) { // we know player1 is paper if (PAPER == player2) { cout << "It is a tie" << endl; } else { // we know player 1 is paper and player 2 is not paper. if (SCISSORS == player2) { cout << "Player 2 wins" << endl; } else { // player1 = paper, player 2 not paper or scissors if (ROCK == player2) { cout << "Player 1 wins" << endl; } else { cout << "Player 2 gave bad input" << endl; } } } } else { // we know player1 is not paper if (SCISSORS == player1) { // player is scissors if (SCISSORS == player2) { cout << "It is a tie" << endl; } else { if (PAPER == player2) { cout << "Player 1 wins" << endl; } else { if (ROCK == player2) { cout << "Player 2 wins" << endl; } else { cout << "Player 2 gave bad input" << endl; } } } } else { // p1 is not Paper or Scissors if (ROCK == player1) { if (ROCK == player2) { cout << "It is a tie" << endl; } else { if (SCISSORS == player2) { cout << "Player 1 wins" << endl; } else { if (PAPER == player2) { cout << "Player 2 wins" << endl; } else { cout << "Player 2 gave bad input" << endl; } } } } else { cout << "Player 1 gave bad input" << endl; } } } return 0; }