B. The Time
time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

You are given the current time in 24-hour format hh:mm. Find and print the time after a minutes.

Note that you should find only the time after a minutes, see the examples to clarify the problem statement.

You can read more about 24-hour format here https://en.wikipedia.org/wiki/24-hour_clock.

Input

The first line contains the current time in the format hh:mm (0 ≤ hh < 24, 0 ≤ mm < 60). The hours and the minutes are given with two digits (the hours or the minutes less than 10 are given with the leading zeroes).

The second line contains integer a (0 ≤ a ≤ 104) — the number of the minutes passed.

Output

The only line should contain the time after a minutes in the format described in the input. Note that you should print exactly two digits for the hours and the minutes (add leading zeroes to the numbers if needed).

See the examples to check the input/output format.

Sample test(s)
input
23:59
10
output
00:09
input
20:20
121
output
22:21
input
10:10
0
output
10:10
题意:给你一个时间问你n分钟后的时间
#include<stdio.h>
#include<string.h>
#include<string>
#include<math.h>
#include<algorithm>
#define LL long long
#define PI atan(1.0)*4
#define DD doublea
#define MAX 1010
#define mod 10007
using namespace std;
int n,m;
int main()
{
int j,i,sum,t;
int x,y,z;
while(scanf("%d:%d",&n,&m)!=EOF)
{
scanf("%d",&t);
x=y=z=0;
x=t%60;
z=t/60;
m=x+m;
if(m>=60)
{
y=m/60;
m=m%60;
}
n=n+z+y;
if(n%24==0)
n=0;
if(n%24!=0)
n=n%24;
printf("%02d:%02d\n",n,m);
}
return 0;
}

  

Codeforces 622B The Time 【水题】的更多相关文章

  1. Codeforces Gym 100531G Grave 水题

    Problem G. Grave 题目连接: http://codeforces.com/gym/100531/attachments Description Gerard develops a Ha ...

  2. codeforces 706A A. Beru-taxi(水题)

    题目链接: A. Beru-taxi 题意: 问那个taxi到他的时间最短,水题; AC代码: #include <iostream> #include <cstdio> #i ...

  3. codeforces 569B B. Inventory(水题)

    题目链接: B. Inventory time limit per test 1 second memory limit per test 256 megabytes input standard i ...

  4. Codeforces 489A SwapSort (水题)

    A. SwapSort time limit per test 1 second memory limit per test 256 megabytes input standard input ou ...

  5. codeforces 688A A. Opponents(水题)

    题目链接: A. Opponents time limit per test 1 second memory limit per test 256 megabytes input standard i ...

  6. CodeForces 534B Covered Path (水题)

    题意:给定两个速度,一个一初速度,一个末速度,然后给定 t 秒时间,还每秒速度最多变化多少,让你求最长距离. 析:其实这个题很水的,看一遍就知道怎么做了,很明显就是先从末速度开始算起,然后倒着推. 代 ...

  7. Codeforces Gym 100286I iSharp 水题

    Problem I. iSharpTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/ ...

  8. CodeForces 705A(训练水题)

    题目链接:http://codeforces.com/problemset/problem/705/A 从第三个输出中可看出规律, I hate that I love that I hate it ...

  9. CodeForces Gym 100685C Cinderella (水题)

    题意:给定 n 个杯子,里面有不同体积的水,然后问你要把所有的杯子的水的体积都一样,至少要倒少多少个杯子. 析:既然最后都一样,那么先求平均数然后再数一下,哪个杯子的开始的体积就大于平均数,这是一定要 ...

  10. CodeForces 931C Laboratory Work 水题,构造

    *这种题好像不用写题解... 题意: 一个人要改动别人的实验记录,实验记录记录是一个集合 实验记录本身满足:$max(X)-min(X)<=2$ 改动结果要求: 1.新的集合平均值和之前的一样 ...

随机推荐

  1. [POJ2828]Buy Tickets(线段树,单点更新,二分,逆序)

    题目链接:http://poj.org/problem?id=2828 由于最后一个人的位置一定是不会变的,所以我们倒着做,先插入最后一个人. 我们每次处理的时候,由于已经知道了这个人的位置k,这个位 ...

  2. JS创建类以及类的方法(StringBuffeer类)

    创建StringBuffer类以及toString,append()方法 //创建一个StringBuffer类 ,此类有两个方法:一个是append方法一个是toString方法 function ...

  3. POJ2796 单调队列

    Feel Good Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 8041   Accepted: 2177 Case Ti ...

  4. bzoj2829

    裸题,直接上凸包,然后加上一个圆周即可 只是在这之前没写过旋转而已 const pi=3.14159265358979323; eps=1e-8; type point=record x,y:doub ...

  5. codevs 1218 疫情控制

    啊好烦这道题.... 基本思路网上都有. 注意的一点是在匹配的时候,如果有军队的来源没有被匹配到,那么就先匹配这个来源.(因为不花钱). 不过数据好水.... #include<iostream ...

  6. eclipse集承jboss服务器

    eclipse Kepler + Jboss7.1 参考引用文档: http://www.tekdigest.com/how-to-install-jboss-tools-in-eclipse.htm ...

  7. php mysql事务

    这里记录一下php操作mysql事务的一些知识 要知道,MySQL默认的行为是在每条SQL语句执行后执行一个COMMIT语句,从而有效的将每条语句独立为一个事务.但是,在使用事务时,是需要执行多条sq ...

  8. Jabber/XMPP协议与架构

    一.概述 由Jeremie Miller于1998年开始这个项目.Jabber是一个开放源码形式组织产生的网络实时通信协议,第一个公开版本于2000年5月发行.Jabber已经由IETF XMPP协议 ...

  9. MySQL基础之第11章 插入、更新与删除数据

    11.1.插入数据 11.1.1.为表的所有字段插入数据 1.INSERT语句中不指定具体的字段名         insert into 表名 values (值1,值2…值n)2.INSERT语句 ...

  10. 从网页监听Android设备的返回键

    最近搞Android项目的时候,遇到一个比较蛋疼的需求,需要从Client App调用系统浏览器打开一个页面,进行杂七杂八的一些交互之后,返回到App.如何打开浏览器和如何返回App这里就不说了,有兴 ...