当前位置:网站首页>7-2 and then what time (15 minutes)
7-2 and then what time (15 minutes)
2022-07-03 14:14:00 【Big fish】
Sometimes people use four digits to represent a time , such as 1106 Express 11 Zero 6 branch . Now? , Your program calculates the end time based on the start time and the elapsed time .
Read in two numbers , The first number represents the current time with such four digits , The second number is the number of minutes , Calculate the current time after so many minutes , The result is also expressed as a four digit number . When the hours are in single digits , Zero without leading , namely 5 spot 30 Points are expressed as 530. Be careful , The second number indicates that the number of minutes may exceed 60, It could also be negative .
Input format :
Enter... On one line 2 It's an integer , They are the starting time represented by four digits 、 And the minutes passed , Separated by spaces . Be careful : In the starting time , When the hours are in single digits , Zero without leading , namely 5 spot 30 Points are expressed as 530; The number of minutes passed may exceed 60, It could also be negative .
Output format :
Output the termination time represented by four digits . The title ensures that the start time and end time are within the same day .
sample input :
1120 110
sample output :
1310
The complete code is as follows :
#include<stdio.h>
int main()
{
int t,p,h,m;
scanf("%d%d",&t,&p);
h=t/100;
m=t%100;
t=h*60+m+p; // The core idea is to convert it into minutes
h=t/60;
m=t%60;
printf("%d%02d",h,m);
}边栏推荐
- Redis:字符串类型数据的操作命令
- 2021年区域赛ICPC沈阳站J-Luggage Lock(代码简洁)
- MongoDB数据库入门的常用命令
- Onmenusharetimeline custom shared content is invalid, and the title and icon are not displayed
- allegro,orcad, net alias,port,off-page connector之间的异同点和如何选取
- Canvas utility library fabric JS user manual
- jvm-运行时数据区
- Programmable logic device software testing
- QT learning 21 standard dialog box in QT (Part 2)
- etcd集群权限管理和账号密码使用
猜你喜欢
随机推荐
556. 下一个更大元素 III
FPGA测试方法以Mentor工具为例
JS Part III
Learn to punch in today
中感微冲刺科创板:年营收2.4亿净亏1782万 拟募资6亿
PCB中常用快捷键
Installation impression notes
js 2023. String pair equal to the target string after connection
QT learning 19 standard dialog box in QT (top)
Onmenusharetimeline custom shared content is invalid, and the title and icon are not displayed
FPGA test method takes mentor tool as an example
page owner特性浅析
jvm-类加载
Exercise 10-1 calculate the sum of 1 to n using recursive functions
28:第三章:开发通行证服务:11:在配置文件中定义属性,然后在代码中去获取;
jvm-运行时数据区
How to bold text in AI
必贝特医药冲刺科创板:年营收97万亏损1.37亿 拟募资20亿
Eight sorts
Uniapp skills - scrolling components -1









