Description

Percy likes to be punctual. So much so that he always keeps three watches with him, so that he can be sure exactly what the time is. However, Percy's having a bad day. He found out that one of his watches was giving the wrong time. What's worse, when he went to correct the watch, he corrected the wrong one! That is, one watch was running x minutes behind (where x480) and he wound one of the other watches x minutes forward. He now has three watches reading three different times, and hence is in serious danger of being tardy. Can you help Percy by writing a program that takes in the three times displayed on the watches and returns the correct time?

Input

The input begins with an integer T indicating the number of cases that follow ( 0 < T < 100). Each of the following T lines contains one test case, made up of three readings, separated by single space characters: H1:M1H2:M2H3:M3 In each reading H1, H2, H3 represent the hours displayed ( 0 < H1, H2, H3 < 13), and M1, M2, M3 represent the minutes displayed ( 0M1, M2, M3 < 60).

If the number of minutes is less than 10, a leading 0 is perpended.

Output

For each test case, one line should be produced, formatted exactly as follows: "The correct time is Hi:Mi". If the number of minutes is less than 10, a leading 0 should be added. If the number of hours is less than 10, a leading 0 should NOT be added. If it is impossible to tell the time from the three readings, print the string: "Look at the sun".

Sample Input

3
5:00 12:00 10:00
11:59 12:30 1:01
12:00 4:00 8:00

Sample Output

The correct time is 5:00
The correct time is 12:30
Look at the sun 题意:时间 a b c 要求随意两个时间间隔相同 则输出中间的那个时间 否则输出 look at the sun
样例1 10 5 12 间隔分别是五
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <cstdlib>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <list>
#include <vector>
#include <iostream>
#include <algorithm>
#include <deque>
#include <ctime>
using namespace std; int main()
{
int n,i,j,t,m,a,b,h1,h2,h3;
int num[];
while(~scanf("%d",&n))
{
while(n--)
{
for(i=;i<;i++)
{
scanf("%d:%d",&a,&b);
num[i]=(a)*+b;
}
sort(num,num+);
h1=num[]-num[];
h2=num[]-num[];
h3=num[]-num[]+;
//cout<<num[0]<<' '<<num[1]<<' '<<num[2]<<endl;
//cout<<h1<<" "<<h2<<" "<<h3<<endl;
if(h1==h2&&h2==h3)
printf("Look at the sun\n");
else if(h1==h2&&h1!=h3)
printf("The correct time is %d:%02d\n",num[]/,num[]%);
else if(h2==h3&&h2!=h1)
printf("The correct time is %d:%02d\n",num[]/,num[]%); ///%02d
else if(h3==h1&&h3!=h2)
printf("The correct time is %d:%02d\n",num[]/,num[]%);
else
printf("Look at the sun\n");
}
} return ;
}

B - Avoiding a disaster的更多相关文章

  1. HDU 4177 模拟时间问题

    Avoiding a disaster Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Othe ...

  2. track message forwards, avoiding request loops, and identifying the protocol capabilities of all senders along the request/response chain

    https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html The TRACE method is used to invoke a remote, ...

  3. 读Avoiding the Disk Bottleneck in the Data Domain Deduplication File System

    最近在思考和实践怎样应用重复数据删除技术到云存储服务中.找了些论文来读,其中<Avoiding the Disk Bottleneck in the Data Domain Deduplicat ...

  4. Disaster Recovery, High Availability, and Continuous Availability - What's the Difference?

    Disaster Recovery, High Availability, and Continuous Availability - What's the Difference? Posted by ...

  5. Avoiding PostgreSQL database corruption

    TL;DR: Don't ever set fsync=off, don't kill -9 the postmaster then deletepostmaster.pid, don't run P ...

  6. PLSQL_性能优化工具系列16_Best Practices: Proactively Avoiding Database

    占位符 PLSQL_性能优化工具系列_Best Practices: Proactively Avoiding Database/Query Performance Issue

  7. Performing a full database disaster recovery with RMAN

    Performing a full database disaster recovery with RMAN1. Make the RMAN backup set pieces available.2 ...

  8. 云区域(region),可用区(AZ),跨区域数据复制(Cross-region replication)与灾备(Disaster Recovery)(部分1)

    本文分两部分:部分1 和 部分2.部分1 介绍 AWS,部分2 介绍阿里云和OpenStack云. 1. AWS 1.1 AWS 地理组件概况 AWS 提供三种地理性组件: Regions:区域,即A ...

  9. High Availability (HA) 和 Disaster Recovery (DR) 的区别

    High availability 和disaster recovery不是一回事. 尽管在规划和解决方案上有重叠的部分, 它们俩都是business contiunity的子集. HA的目的是在主数 ...

随机推荐

  1. 20172306《Java程序设计与数据结构》第八周学习总结

    20172306<Java程序设计>第8周学习总结 教材学习内容总结 第十章最开始自己看的时候,没怎么看懂,等老师讲完之后,又看了一遍,就理解了很多.第十章主要学习了以下几点: 1.对于几 ...

  2. Java界面编程—API

    Java 的 GUI 提供的对象都存在 java.awt 和 java.swing 两个包中. awt :Abstract Window ToolKit(抽象窗口工具包),需要调用本地系统方法实现功能 ...

  3. python range用法

    1. range(n) 相当于枚举 从0<=i<n的整数 增量为1 for i in range(4): print(i) 结果:0 1 2 3 2. range(5,10) 相当于枚举 ...

  4. Permutation Sequence LT60

    The set [1,2,3,...,n] contains a total of n! unique permutations. By listing and labeling all of the ...

  5. 【UI测试】--独特性

  6. js对象通过属性路径获取属性值 - getPropByPath

    function getPropByPath(obj, path) { let tempObj = obj; path = path.replace(/\[(\w+)\]/g, '.$1'); pat ...

  7. CRC-32的原理和实现

    /* crc32.c -- compute the CRC-32 of a data stream * Copyright (C) 1995-2002 Mark Adler * For conditi ...

  8. js监听微信、支付宝返回,后退、上一页按钮事件

    $(function(){ pushHistory(); window.addEventListener("popstate", function(e) { alert(" ...

  9. hdu6444 2018中国大学生程序设计竞赛 - 网络选拔赛 1007 Neko's loop

    Neko's loop Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total S ...

  10. Win7 VS2015环境编译cegui-0.8.5

    首先是去官网下载源码与依赖库 http://cegui.org.uk/ 然后得提一下,编译DX11版本带Effects11框架的话会有问题,也就是默认情况编译有问题,这是因为VS2015升级后编译器对 ...