If practice 3
Submit solution
C, C++, Python3
Points:
1
Time limit:
1.0s
Memory limit:
64M
Author:
Problem type
Allowed languages
This practice problem will require you to programme basic if
conditions and
else
.
Your very good friends Tom and Jerry are playing dice, and they want you to be the judge. They are using 2 dice to play the game and they will ask you to determine who the winner is.
For each round, you will see the numbers Tom and Jerry rolled. And there are the rules:
1. If one player's total points is greater than the other, that player wins.
2. If two players' points are the same, and one player has two dice with the same number while the other doesn't, then that player wins.
3. Otherwise, it is a tie.
Input Specification
The first line will contain two space-separated integers whose absolute value ranges from 1 to 6. These are the two dice rolled by Tom.
The second line will contain two space-separated integers whose absolute value ranges from 1 to 6. These are the two dice rolled by Jerry.
Output Specification
Output either the winner's name, or It is a Tie!
.
Sample Input 1
1 6
2 4
Sample Output 1
Tom
Sample Input 2
4 4
3 5
Sample Output 2
Tom
Sample Input 2
2 6
3 5
Sample Output 2
It is a Tie!
Comments