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.

Examples
input
23:59
10
output
00:09
input
20:20
121
output
22:21
input
10:10
0
output
10:10

题意:问从起点时间经过所给的时间,终点时间是多少;

思路:将时间都转换成分钟;

AC代码:

#include <bits/stdc++.h>
using namespace std;
char str[8];
int a;
int main()
{
scanf("%s",str);
scanf("%d",&a);
int x1,x2;
x1=(str[0]-'0')*10+(str[1]-'0');
x2=(str[3]-'0')*10+(str[4]-'0');
//cout<<x1<<":"<<x2<<"\n";
x2+=a;
x1+=x2/60;
x2%=60;
x1%=24;
if(x1<10)printf("0%d:",x1);
else printf("%d:",x1);
if(x2<10)printf("0%d\n",x2);
else printf("%d\n",x2);
return 0;
}

最新文章

  1. hexo+github搭建个人博客
  2. 如何在Ubuntu上配置scala教程
  3. 从零开始写一个武侠冒险游戏-7-用GPU提升性能(2)
  4. javascript中json解密
  5. Ubuntu 安装 Brother MFC7470D 驱动
  6. Android --slidedatetimepicker时间控件应用
  7. ssh 命令
  8. MyEclipse各种操作
  9. hdu 4099 Revenge of Fibonacci 大数+压位+trie
  10. telnet简单操作 模拟请求
  11. android textview 行间距
  12. android中ScrollView和GridView/ListView共存时,ScrollView不在顶部的解决方法
  13. 不直接访问远程的数据库,而是通过中间件(专业DBA的博客)
  14. 15个最好的HTML5前端响应式框架(2014)
  15. JS 高效快速的数组去重
  16. viewpager处理(二):设置当前item时,让viewpager不出现滑动动画
  17. Java面试07|Redis数据库
  18. RxJS操作符(三)
  19. Linux-3.0.8 input subsystem代码阅读笔记
  20. git从其他分支提取文件merge到当前分支

热门文章

  1. Matlab典型论坛
  2. html5+css3实现手机下拉和下拉刷新
  3. java类型系统知识点总结
  4. JMeter 通过CSV Data Set Config 中文参数化数据,插入数据库后中文显示乱码,解决办法
  5. 【BZOJ5018】[Snoi2017]英雄联盟 背包
  6. 九度OJ 1325:Battle Over Cities(城市间的战争) (并查集)
  7. bash编程基础
  8. A norm is a function. 范数是函数。
  9. Delphi编译指令说明
  10. Swift学习笔记十一:方法