哈理工OJ 2304 Julyed(水题)

本题是一道简单的判断题,通过输入X(Tomriddly到达机场所需时间)、Y(Julyed到达机场的时间)及Z(巴士停靠时间),判断两人见面时Julyed的情绪状态。根据不同的等待时间输出不同的结果。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

题目链接:http://acm.hrbust.edu.cn/index.php?m=ProblemSet&a=showProblem&problem_id=2304

Julyed
Time Limit: 1000 MS Memory Limit: 131072 K
Total Submit: 55(23 users) Total Accepted: 23(23 users) Rating: Special Judge: No
Description
Julyed is a smart pretty girl and tomriddly is her boyfriend. Now tomriddly is on the bus to the airport to see Julyed. He still needs X minutes to get the airport. But Julyed will arrive in Y minutes. What’s worse is that the terrible traffic! The bus will have to stop here for Z minutes! Julyed will happily wait for tomriddly at most 10 minutes, but will be mad after waiting at least 30 minutes. What will happened when they meet?
Input
Multiple test cases. The first line contains a positive integer T (T <= 100), indicates the number of test cases.

Each test case contains three non-negative integers X, Y, Z (X, Y, Z <= 60) descripted as above in one line.

Output
One line per case.

If Julyed will be happy, output “memeda”(without quotes).

If Julyed will be mad, output “QAQ”(without quotes).

Otherwise output how long will Julyed wait.

Sample Input
4

10 10 0

10 10 10

10 5 10

60 10 60

Sample Output
memeda

memeda

15

QAQ

Source
“尚学堂杯”哈尔滨理工大学第六届程序设计竞赛

【思路分析】直接判断x+z-y的值在哪个区间就好了,然后直接输出。
【AC代码】

#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int x,y,z;
        scanf("%d%d%d",&x,&y,&z);
        if(x+z-y<=10)
        {
            printf("memeda\n");
        }
        else if(x+z-y>=30)
        {
            printf("QAQ\n");
        }
        else
        {
            printf("%d\n",x+z-y);
        }
    }
    return 0;
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值