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);
}

转载于:https://www.cnblogs.com/qscqesze/p/5187033.html

Educational Codeforces Round 7 B. The Time 水题相关推荐

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

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

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

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

  3. Educational Codeforces Round 11 C hard process_补题——作为司老大的脑残粉

    司老大当时教了一种姿势枚举连续K个0,说实话当时比赛写这题完全蒙了 纵然后来知道思路还是写了一段时间 真的是.. 题目大意 n长度的序列,由0 1构成 我们可以改变 k个0为1 求可以得到的最长连续1 ...

  4. Educational Codeforces Round 111 (Rated for Div. 2)

    Educational Codeforces Round 111 (Rated for Div. 2) 题号 题目 知识点 A Find The Array B Maximum Cost Deleti ...

  5. Educational Codeforces Round 106 (Rated for Div. 2)

    Educational Codeforces Round 106 (Rated for Div. 2) 题号 题目 知识点 A Domino on Windowsill B Binary Remova ...

  6. Educational Codeforces Round 112 (Rated for Div. 2)

    Educational Codeforces Round 112 (Rated for Div. 2) 题号 题目 知识点 A PizzaForces B Two Tables C Coin Rows ...

  7. Educational Codeforces Round 107 (Rated for Div. 2)

    Educational Codeforces Round 107 (Rated for Div. 2) 题号 题目 知识点 A Review Site 签到 B GCD Length 思维+构造 C ...

  8. Educational Codeforces Round 32

    http://codeforces.com/contest/888 A Local Extrema[水] [题意]:计算极值点个数 [分析]:除了第一个最后一个外,遇到极值点ans++,包括极大和极小 ...

  9. Educational Codeforces Round 89 (Rated for Div. 2)(A, B, C, D)

    Educational Codeforces Round 89 (Rated for Div. 2) A. Shovels and Swords 思路 题意非常简单,就是得到最多的物品嘛,我们假定a, ...

最新文章

  1. UVA 311 Packets
  2. mysql 开发基础系列18 存储过程和函数(下)
  3. 修复错误ModuleNotFoundError: No module named ‘pip‘
  4. Python IDLE(shell清屏配置方法)
  5. 图片压缩质量并保存指定尺寸
  6. 【qduoj - 1011】数组中出现最多的元素(巧妙方法 或 排序 或 map)
  7. php 的定界符 eof
  8. OpenCV萌新福音:易上手的数字识别实践案例
  9. 【echarts】 tooltip显示图片
  10. OpenCV-寻找非零点cv::findNonZero
  11. python代码_Python代码的优化技巧
  12. 【算法设计与分析】HDU-1108 C++诡异的楼梯(BFS迷宫最短路径)
  13. 深度Linux桌面图标,图标推荐 Deepin plus 所有图标集
  14. Android四大组件生命周期
  15. 枢轴点(Pivot Point)系统
  16. 什么是one-hot?
  17. 政务外网部署 minio上传下载报错 javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
  18. selenium淘宝爬虫
  19. 杨晓峰-java核心技术36讲(学习笔记)- 第1讲 | 谈谈你对Java平台的理解?
  20. 阿里云天池python1

热门文章

  1. ActiveMQ传输文件的几种方式原理与优劣
  2. OpenMP: OpenMP编程指南
  3. Entity Framework Core 2.0的突破性变更
  4. 美国会议员提出“漏洞披露法案” 仍考虑非中立实体授权
  5. 简单的在jsp页面操作mysql
  6. ILockBytes Windows Mobile 6.5
  7. gulp自动化构建工具--压缩css--学习笔记
  8. 【Android开发】图形图像处理技术-绘制几何图形
  9. Firefox 扩展开发 install.rdf和chrome.manifest
  10. Linq to SQL Like Operator(转)