Time Limit: 1000MS Memory Limit: 65536KB
Problem Description
UMR worries if she should wear her dress today, so that she decided to throw dice to decide whether to wear her dress or not. UMR has three dices and she will throw dice twice. Because she has three dices, she makes an unusual rule of the dice point.
1、if there are two dice points which are the same, the point of these three dice is the point of the third dice
2、if there are three dice points are the same, it is a miraculous point. The point of these three dice equals the point of each dice. Miraculous point is bigger than the point of two dices which are the same.
3、if all dices are diffirent, the point of these three dice is 0.
If the first throw more points than the second, she will put on her dress. If the second throw more point than than the first, she will not put on her dress. If the points of twice throw are the same, she will try again.
Input
There are several cases of input, ending up with EOF.
For each case there is one line of input with six integers x1, x2, x3, y1, y2, y3
(1<= x1,x2,x3,y1,y2,y3 <= 6), x1, x2, x3 means the point of first throw, y1,y2,y3 means the point of second throw.
Output
There are one line of output. If UMR will put on her dress, print"Put on my dress.". If not, print“What a pity.”. If she will try again, print“Let me try again.”
Example Input
4 5 6 2 2 1 1 1 1 6 5 5 3 1 1 5 3 5
Example Output
What a pity. Put on my dress. Let me try again.
Author
#include <stdio.h>
int f(int a,int b,int c)
{
if(a!=b&&a!=c&&b!=c)
return -1;
if(a==b&&a==c&&b==c)
return 10*a;
if(a==b&&a!=c)
return c;
if(a==c&&a!=b)
return b;
if(b==c&&b!=a)
return a;
}
int main()
{
int x1,x2,x3,y1,y2,y3;
while(~scanf("%d%d%d%d%d%d",&x1,&x2,&x3,&y1,&y2,&y3))
{
int u1 = f(x1,x2,x3);
int u2 = f(y1,y2,y3);
if(u1>u2)
printf("Put on my dress.\n");
else if(u1==u2)
printf("Let me try again.\n");
else
printf("What a pity.\n");
}
return 0;
}