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

题目链接

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;
}



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值