B. The Time

题目连接:

http://www.codeforces.com/contest/622/problem/B

Description

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 Input

23:59

10

Sample Output

00:09

Hint

题意

给你现在的时间,然后问你过了k分钟后,是几点了

题解:

水题啦,题数喜+1

代码

#include<bits/stdc++.h>
using namespace std; string s;
int h,m,ss;
int main()
{
cin>>s; for(int i=0;i<2;i++)
h=h*10+(s[i]-'0');
for(int i=3;i<s.size();i++)
m=m*10+(s[i]-'0');
cin>>ss;
m +=ss;
int k = m/60;
m=m%60;
h=(h+k)%24;
printf("%02d:%02d\n",h,m);
}

Educational Codeforces Round 7 B. The Time 水题的更多相关文章

  1. Educational Codeforces Round 7 A. Infinite Sequence 水题

    A. Infinite Sequence 题目连接: http://www.codeforces.com/contest/622/problem/A Description Consider the ...

  2. Educational Codeforces Round 11 A. Co-prime Array 水题

    A. Co-prime Array 题目连接: http://www.codeforces.com/contest/660/problem/A Description You are given an ...

  3. Educational Codeforces Round 10 C. Foe Pairs 水题

    C. Foe Pairs 题目连接: http://www.codeforces.com/contest/652/problem/C Description You are given a permu ...

  4. Educational Codeforces Round 24 CF 818 A-G 补题

    6月快要结束了 期末也过去大半了 马上就是大三狗了 取消了小学期后20周的学期真心长, 看着各种北方的学校都放假嗨皮了,我们这个在北回归线的学校,还在忍受酷暑. 过年的时候下定决心要拿块ACM的牌子, ...

  5. Educational Codeforces Round 5(A,B题)

    虽然是水题但还是贴下代码把 A #include<cstring> #include<cstdio> using namespace std; ; char x[qq],y[q ...

  6. Codeforces Round #300 A. Cutting Banner 水题

    A. Cutting Banner Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/538/pro ...

  7. Educational Codeforces Round 2 A. Extract Numbers 模拟题

    A. Extract Numbers Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/600/pr ...

  8. Codeforces Round #300 D. Weird Chess 水题

    D. Weird Chess Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/538/proble ...

  9. Codeforces Round #300 B. Quasi Binary 水题

    B. Quasi Binary Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/538/probl ...

随机推荐

  1. 解决 winform 界面对不齐 z

    一个winform的程序,本机上界面对得很齐,到一到客户的机器上就惨不忍睹,一番研究后搞定: 1. AutoScaleMode = None 2. BackgroundImageLayout = No ...

  2. Oracle中本行记录和上一行记录进行比较lead over 函数处理

    遇到问题:多表关联查询,有一个要求是,同一保单号,对应多个投资产品Code.以及投资比例,每一个保单号有一个总的投资金额.要求同一保单号那一行,只有第一个总金额有值,剩下的code对应的总金额置空. ...

  3. linux 学习网站

    study-Area:http://www.study-area.org 鸟哥的私房菜:http://linux.vbird.org 鸟哥的私房菜课后答案:http://wapwenku.baidu. ...

  4. sql统计重复数据

    sql代码如下: 统计重复的数据 select MingCheng from tabShouFeiGongShi group by MingCheng having count(MingCheng) ...

  5. Android 设置 横屏 竖屏 (转)

    http://2960629.blog.51cto.com/2950629/701227 方法一:在AndroidManifest.xml中配置 如果不想让软件在横竖屏之间切换,最简单的办法就是在项目 ...

  6. Maven,预加载资源文件

    预加载资源文件需要先启用功能: <build> <resources> <resource> <directory>src/main/resources ...

  7. Android Audio遇到播放无声时的分析

    在Android Audio开发过程中,有遇到播放ringtone时无声,但播放Music可以听到声音,关于无声问题的分析,在此做个笔记,方便以后回顾. 分析方向: 1:在音量控制面板中确认该音频流对 ...

  8. cookie一些简单的操作

    cookie 保存数据      document.cookie=name+'='+value+';expires='+date; //name=shiyou ;expires=Tue Mar 08 ...

  9. 【转】Eclipse去除js(JavaScript)验证错误

    这篇文章主要是对Eclipse去除js(JavaScript)验证错误进行了介绍.在Eclipse中,js文件常常会报错.可以通过如下几个步骤解决 第一步:去除eclipse的JS验证:将window ...

  10. oracle max()函数和min()函数

    当需要了解一列中的最大值时,可以使用MAX()函数:同样,当需要了解一列中的最小值时,可以使用MIN()函数.语法如下. SELECT          MAX (column_name) / MIN ...