您的位置:首页 > 理论基础 > 计算机网络

第九届山东理工大学ACM网络编程擂台赛 正式赛 sdut4080 UMR's dress

2017-11-21 22:18 363 查看
题目链接

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

玄黄

思路:签到题,看懂题就没什么大难度,3个骰子点数都不同时点数为0,2个点数相同时点数为第三个,3个点数都相同时点数比2个点数相同时要大,可以把他多加6(或更大的数)或乘7(或更大的数)来处理

#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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  acm 网络编程
相关文章推荐