CJCoding With Joseph
15free / daySign inCreate account

Rock Paper Scissors Winner

Read 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
Topics:
If Statements
📥 Auto-Input:
R S\n
This input is automatically fed to your program's stdin
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.