Problem description Rock, Paper, Scissors is a two player game, where each player simultaneously chooses one of the three items after counting to three. the game typically lasts a pre-determined number of rounds. the player who wins the most rounds wins the game. given the number of rounds the players will compete, it is your job to determine which player wins after those rounds have been played.
The rules for what item wins are as follows:
? Rock always beats scissors (rock crushes scissors)
? Scissors always beat paper (scissors cut paper)
? Paper always beats rock (Paper covers rock)
Input the first value in the input file will be an integer T (0 <t <1000) representing the number of test cases in the input file. following this, on a case by case basis, will be an integer N (0 <n <100) specifying the number of rounds of Rock, Paper, Scissors played. next will be n lines, each with either a capital R, P, or s, followed by a space, followed by a capital R, P, or s, followed by a newline. the first letter is Player 1 choice; the second letter is Player 2 choice.
Output for each test case, report the name of the player (Player 1 or PLAYER 2) that wins the game, followed by a newline. if the game ends up in a tie, print tie.
Sample input 3
2
R p
S r
3
P
R S
S r
1
P R
Sample output PLAYER 2
Tie
PLAYER 1
Fake questions
I am embarrassed to make a problem-solving report.
# Include <stdio. h> int fun (char a, char B) {If (A = 'R' & B ='s ') | (A = 's' & B = 'P') | (A = 'P' & B = 'R') return 1; return 0;} int main () {int n, m; char a, B; scanf ("% d", & M); While (M --) {int Suma = 0, sumb = 0; scanf ("% d % * C", & N); While (n --) {scanf ("% C ", & A, & B); getchar (); Suma + = fun (a, B); sumb + = fun (B, A);} If (SUMA> sumb) printf ("Player 1 \ n"); else if (SUMA = sumb) printf ("Tie \ n"); else printf ("Player 2 \ n ");}}