Rock Paper Scissors Winner
hardQuestion 344Read two characters with scanf(" %c %c", ...) for player 1 and player 2. Each is R (rock), P (paper), or S (scissors). Rock beats scissors, scissors beats paper, and paper beats rock. Print the result with no trailing newline:
print Player 1 if player 1 wins, Player 2 if player 2 wins, or Tie if they match.
For input R S the output is Player 1; for R P it is Player 2; for R R it is Tie.
Expected output
Player 1= newline. No newline after the last line.
Hints4 available
Sign in to use hintsTopics
If Statements
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.