โ Back to If Statements
Question 274
Rock Paper Scissors Winner
Rock Paper Scissors Winner
Read two characters withscanf(" %c %c", ...)for player 1 and player 2. Each isR(rock),P(paper), orS(scissors). Rock beats scissors, scissors beats paper, and paper beats rock. Print the result with no trailing newline: printPlayer 1if player 1 wins,Player 2if player 2 wins, orTieif they match. For inputR Sthe output isPlayer 1; forR Pit isPlayer 2; forR Rit isTie.
Expected Output:
Player 1
Topics:
If Statements
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท 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.