当前位置:网站首页>Time conversion ()
Time conversion ()
2022-07-03 14:33:00 【Study hard 867】
This question requires the preparation of procedures , With hh:mm:ss Output in the format of... After a given time n Time value after seconds ( exceed 23:59:59 From 0 The clock starts at ).
Input format :
Enter in the first line with hh:mm:ss The format of gives the start time , The second line gives the number of whole seconds n(<60).
Output format :
The output is given on one line hh:mm:ss Result time in format .
sample input :
11:59:40
30
sample output :
12:00:10Code :
#include <stdio.h>
int main(){
int h,m,s;
scanf("%d:%d:%d",&h,&m,&s);
int n;
scanf("%d",&n);
n=n+s;
if(n>=60){
n=n%60;
m++;
if(m>=60){
m=m%60;
h++;
}
}
if(h==24)h=h-24;
printf("%02d:%02d:%02d",h,m,n);
}
边栏推荐
- retrofit
- Detailed explanation of four modes of distributed transaction (Seata)
- Exercise 8-2 calculate the sum and difference of two numbers
- China PETG market forecast and Strategic Research Report (2022 Edition)
- Convert string to decimal integer
- SSH access control, blocking the IP when logging in repeatedly to prevent brute force cracking
- Tonybot humanoid robot infrared remote control play 0630
- tonybot 人形机器人 红外遥控玩法 0630
- 7-23 currency conversion (using array conversion)
- 天谋科技 Timecho 完成近亿元人民币天使轮融资,打造工业物联网原生时序数据库
猜你喜欢

Understand the application scenario and implementation mechanism of differential segment

【北大青鸟昌平校区】互联网行业中,哪些岗位越老越吃香?

Leetcode (4) - - trouver la médiane de deux tableaux ordonnés positifs

天图投资冲刺港股:资产管理规模249亿 投了小红书与奈雪

修改数据库中的记录为什么报这个错

分布式事务(Seata) 四大模式详解

Similarities and differences between Allegro, OrCAD, net alias, port, off page connector and how to select them

Paper sharing: generating playful palettes from images

愉悦资本新双币基金近40亿元完成首次关账

剑指 Offer 28. 对称的二叉树
随机推荐
7-2 and then what time (15 minutes)
7-17 crawling worms (break exercise)
Similarities and differences between Allegro, OrCAD, net alias, port, off page connector and how to select them
洛谷P5536 【XR-3】核心城市 题解
Sub-GHz无线解决方案Z-Wave 800 系列ZG23 soc和ZGM230S模块
Programming language: the essence of type system
中感微冲刺科创板:年营收2.4亿净亏1782万 拟募资6亿
FPGA blocking assignment and non blocking assignment
Showmebug entered Tencent conference, opening the era of professional technical interview
亚马逊、速卖通、Lazada、Shopee、eBay、wish、沃尔玛、阿里国际、美客多等跨境电商平台,测评自养号该如何利用产品上新期抓住流量?
全文检索引擎Solr系列—–全文检索基本原理
Detailed explanation of four modes of distributed transaction (Seata)
How Facebook moves instagram from AWS to its own server
洛谷P3065 [USACO12DEC]First! G 题解
数学常数表 by q779
How to query the baby category of tmall on Taobao
2021年区域赛ICPC沈阳站J-Luggage Lock(代码简洁)
Solr series of full-text search engines - basic principles of full-text search
Mysql多表查询 #子查询
Exercise 10-6 recursively find Fabonacci sequence