当前位置:网站首页>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);
}
边栏推荐
- Use of constraintlayout
- Showmebug entered Tencent conference, opening the era of professional technical interview
- 使用并行可微模拟加速策略学习
- Recent learning summary
- Similarities and differences between Allegro, OrCAD, net alias, port, off page connector and how to select them
- Thinking about the arrangement problem in the backtracking problem (leetcode questions 46 and 47)
- ConstraintLayout 的使用
- 添加Zabbix计算类型项目Calculated items
- Tiantu investment sprint Hong Kong stocks: asset management scale of 24.9 billion, invested in xiaohongshu and Naixue
- 7-24 reduction of the simplest fraction (rolling Division)
猜你喜欢

Frequently asked questions: PHP LDAP_ add(): Add: Undefined attribute type in

Leetcode(4)——尋找兩個正序數組的中比特數

Puzzle (016.4) domino effect

NPM install is stuck with various strange errors of node NPY

中感微冲刺科创板:年营收2.4亿净亏1782万 拟募资6亿

Tonybot humanoid robot infrared remote control play 0630

使用并行可微模拟加速策略学习

tonybot 人形机器人 查看端口并对应端口 0701

Programming language: the essence of type system

牛客网:过河卒
随机推荐
Mongodb index
MongoDB索引
fpga阻塞赋值和非阻塞赋值
全文检索引擎Solr系列—–全文检索基本原理
7-23 currency conversion (using array conversion)
SSH访问控制,多次失败登录即封掉IP,防止暴力破解
String sort
Thinking about the arrangement problem in the backtracking problem (leetcode questions 46 and 47)
FPGA blocking assignment and non blocking assignment
Sword finger offer 28 Symmetric binary tree
C library function - qsort()
tonybot 人形机器人 定距移动 代码编写玩法
Thread. Sleep and timeunit SECONDS. The difference between sleep
Too many files with unapproved license
String reverse order
Exercise 10-8 recursive implementation of sequential output of integers
556. 下一个更大元素 III
Happy capital new dual currency fund nearly 4billion yuan completed its first account closing
PCB中常用快捷键
puzzle(016.4)多米诺效应