当前位置:网站首页>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);
}
边栏推荐
- adc128s022 ADC verilog设计实现
- Happy capital new dual currency fund nearly 4billion yuan completed its first account closing
- Exercise 10-6 recursively find Fabonacci sequence
- Mongodb index
- 7-22 tortoise and rabbit race (result oriented)
- DDK for XP
- Thread. Sleep and timeunit SECONDS. The difference between sleep
- Facebook 如何将 Instagram 从 AWS 搬到自己的服务器
- How to query the baby category of tmall on Taobao
- Thinking about the arrangement problem in the backtracking problem (leetcode questions 46 and 47)
猜你喜欢

ConstraintLayout 的使用

Happy capital new dual currency fund nearly 4billion yuan completed its first account closing

牛客网:过河卒

Sword finger offer 28 Symmetric binary tree

Jiuyi cloud black free encryption free version source code

Sub-GHz无线解决方案Z-Wave 800 系列ZG23 soc和ZGM230S模块

Exercise 10-6 recursively find Fabonacci sequence

Why is this error reported when modifying records in the database

Exercise 10-1 calculate the sum of 1 to n using recursive functions
![[clean up the extraordinary image of Disk C]](/img/0d/331115bc5d82d6337ae975a08494b2.jpg)
[clean up the extraordinary image of Disk C]
随机推荐
7-18 finding the single root of polynomial by dichotomy
String substitution
常见问题之PHP——ldap_add(): Add: Undefined attribute type in
全文检索引擎Solr系列—–全文检索基本原理
编程语言:类型系统的本质
JVM garbage collector
愉悦资本新双币基金近40亿元完成首次关账
X86 assembly language - Notes from real mode to protected mode
Sendmail can't send mail and it's too slow to send. Solve it
Paper sharing: generating playful palettes from images
Happy capital new dual currency fund nearly 4billion yuan completed its first account closing
适用于XP的DDK
protobuf与grpc
一文了解微分段应用场景与实现机制
tonybot 人形机器人 查看端口并对应端口 0701
Facebook 如何将 Instagram 从 AWS 搬到自己的服务器
npm install卡住与node-npy的各种奇怪报错
7-4 BCD decryption (10 points)
天谋科技 Timecho 完成近亿元人民币天使轮融资,打造工业物联网原生时序数据库
Exercise 6-6 use a function to output an integer in reverse order