CF387A.George and Sleep

入门

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

George woke up and saw the current time s on the digital clock. Besides, George knows that he has slept for time t.

Help George! Write a program that will, given time s and t, determine the time p when George went to bed. Note that George could have gone to bed yesterday relatively to the current time (see the second test sample).

乔治醒来,看到数字钟上显示的当前时间为 ss。此外,乔治知道他睡了 tt 长时间。

请帮助乔治!编写一个程序,在给定时间 ss 和 tt 的情况下,计算出乔治入睡的时间 pp。注意:相对于当前时间,乔治可能是在昨天入睡的(参见第二个测试样例)。

输入格式

The first line contains current time s as a string in the format "hh:mm". The second line contains time t in the format "hh:mm" — the duration of George's sleep. It is guaranteed that the input contains the correct time in the 24-hour format, that is, 00 ≤ hh ≤ 23, 00 ≤ mm ≤ 59.

第一行包含当前时间 ss,格式为字符串 "hh:mm"。
第二行包含时间 tt,格式为 "hh:mm" —— 表示乔治的睡眠时长。
保证输入的时间符合 24 小时制格式,即 00≤hh≤2300 \leq hh \leq 23,00≤mm≤5900 \leq mm \leq 59。

输出格式

In the single line print time p — the time George went to bed in the format similar to the format of the time in the input.

在单行中输出时间 p —— 乔治睡觉的时间,格式与输入中的时间格式相同。

输入输出样例

  • 输入#1

    05:50
    05:44

    输出#1

    00:06
  • 输入#2

    00:00
    01:00

    输出#2

    23:00
  • 输入#3

    00:01
    00:00

    输出#3

    00:01

说明/提示

In the first sample George went to bed at "00:06". Note that you should print the time only in the format "00:06". That's why answers "0:06", "00:6" and others will be considered incorrect.

In the second sample, George went to bed yesterday.

In the third sample, George didn't do to bed at all.

在第一个样例中,乔治于“00:06”上床睡觉。注意,你只需按“00:06”这一格式输出时间。因此,“0:06”、“00:6”等其他格式的答案均被视为错误。

在第二个样例中,乔治是昨天上床睡觉的。

在第三个样例中,乔治根本没有上床睡觉。

输入解题思路,AI测评打分。不知道怎么写?

首页