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. Raw Socket(原始套接字)实现Sniffer(嗅探)

    参考资料: https://www.xuebuyuan.com/3190946.html https://blog.csdn.net/zxygww/article/details/52093308 i ...

  2. [转]sqlmap使用教程

    sqlmap也是渗透中常用的一个注入工具,其实在注入工具方面,一个sqlmap就足够用了,只要你用的熟,秒杀各种工具,只是一个便捷性问题,sql注入另一方面就是手工党了,这个就另当别论了. 今天把我一 ...

  3. hdfs结构

    hdfs文件系统主要由四部分组成:client客户端.namenode.datanode.secondary namenode. client:1.分割文件成block.   2.与namenode交 ...

  4. vs2017控制python版本

    在python环境下拉菜单里面任意一个点右键,选择打开此处的命令提示符,就能把cmd开启的python版本切换到这个版本.

  5. HYSBZ - 3676

    模板题.问你一个串里最大的值(回文子串*出现次数) /* gyt Live up to every day */ #include<cstdio> #include<cmath> ...

  6. python ui学习过程,使用pyqt5实现

    首先安装pyqt5的包,然后打开notebook就可以编写了.当然这样编写,也可以用designer进行. 它是pyqt5-tools的一个exe软件,\Anaconda3\Lib\site-pack ...

  7. hdu-4300(字符串hash)

    题目链接:传送门 参考文章:传送门 思路: (1)对字符串进行翻译,求出s1(未翻译),s2(已翻译)字符串,并分别对s1,s2进行hash操作. (2)比较s1的后x位和s2的前x位的hash值,求 ...

  8. 使用 docker compose 安装 tidb

    目标 : 单机上通过 Docker Compose 快速一键部署一套 TiDB 测试集群 前提条件: 1.centos版本在7.3 以上 2.安装git 3.安装docker Docker versi ...

  9. windows、linux下通过ftp上传文件小脚本

    一.windows @echo off #open ip 将要上传文件的IP地址echo open IP>ftp.up #用户名echo ninic>>ftp.up #密码echo ...

  10. i2c设备驱动注册

      Linux I2C设备驱动编写(二) 原创 2014年03月16日 23:26:50   在(一)中简述了Linux I2C子系统的三个主要成员i2c_adapter.i2c_driver.i2c ...