博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
暑假练习赛 007 A - Time
阅读量:5751 次
发布时间:2019-06-18

本文共 1928 字,大约阅读时间需要 6 分钟。

A - Time

 

Description

standard input/output

A plane can go from city X to city Y in 1 hour and 20 minutes. However, when it returns from city Y to city X, with the same speed, it spends only 80 minutes! If you don’t know how might that happen, just remember that 1 hour and 20 minutes is the same as 80 minutes ;-) In this problem you will have 2 durations of time and you have to decide if they are equal or not.

Input

The first line will be the number of test cases T. Each test case has two lines, the first line represents the first duration and contains 3 integers: h, m, s; these are the Hours, Minutes and Seconds. The second line represent the second duration with 3 integers also, in the same way. All integers are positive and below 5000.

Output

For each test case, print one line which contains the number of the test case. Then print “Yes” if the 2 durations are equal and print “No” otherwise, see the samples and follow the output format.

Sample Input

 
 
 
Input
3 1 20 0 0 80 0 0 2 10 0 0 130 2 10 5 2 11 0
Output
Case 1: Yes Case 2: Yes Case 3: No
/*给出时分秒,看两个时间是否相同*/#include
#include
#include
#include
#include
#define N 200010using namespace std;int main(){ //freopen("in.txt","r",stdin); int t,n; scanf("%d",&t); for(int l=1;l<=t;l++) { long long s1=0,s2=0; for(int i=0;i<3;i++) { scanf("%d",&n); s1+=n; s1*=60; } for(int i=0;i<3;i++) { scanf("%d",&n); s2+=n; s2*=60; } if(s1==s2) printf("Case %d: Yes\n",l); else printf("Case %d: No\n",l); } return 0;}

 

转载于:https://www.cnblogs.com/wuwangchuxin0924/p/5800955.html

你可能感兴趣的文章
Win 8创造颠覆性体验:预览版关键更新
查看>>
vim在多文件中复制粘贴内容
查看>>
初遇 Ext3grep
查看>>
蓝屏分析
查看>>
Android ContentObserver
查看>>
微管理——给你一个技术团队,你该怎么管
查看>>
文章“关于架构优化和设计,架构师必须知道的事情”
查看>>
疯狂java学习笔记1002---非静态内部类
查看>>
ISA2006实战系列之一:实战ISA三种客户端部署方案(上)
查看>>
TCP服务器
查看>>
OCS和GLPI 安装文档
查看>>
U-Mail邮件系统与泛微OA系统一体化操作指南
查看>>
合并两个list集合并且排序
查看>>
AC旁挂三层交换机管理ap,二层接入ap心得
查看>>
DC/OS虚拟网络
查看>>
如何将Exchange 2010 CU15更新到CU26 - 解决CVE安全漏洞
查看>>
JS中比较数字大小
查看>>
POST中文转码问题
查看>>
springcloud 学习-eureka搭建-为eureka添加认证
查看>>
jQuery插件的开发
查看>>