当前位置:网站首页>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);
}边栏推荐
- Uniapp tips - scrolling components
- Exercise 9-3 plane vector addition
- UiO-66-COOH装载苯达莫司汀|羟基磷灰石( HA) 包裹MIL-53(Fe)纳米粒子|装载黄芩苷锰基金属有机骨架材料
- etcd集群权限管理和账号密码使用
- Selenium browser (1)
- Although not necessarily the best, it must be the hardest!
- QT learning 25 layout manager (4)
- Leetcode (4) - - trouver la médiane de deux tableaux ordonnés positifs
- [ACNOI2022]猜数
- JVM runtime data area
猜你喜欢

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

NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线

allegro,orcad, net alias,port,off-page connector之间的异同点和如何选取

Redis:Redis的数据结构、key的操作命令

交联环糊精金属有机骨架负载甲氨蝶呤缓释微粒|金属-有机多孔材料UiO-66负载黄酮苷类药物|齐岳

Scroll detection of the navigation bar enables the navigation bar to slide and fix with no content
[email protected]纳米颗粒)|纳米金属有机框架搭载雷帕霉素|科研试剂"/>金属有机骨架材料ZIF-8包载姜黄素([email protected]纳米颗粒)|纳米金属有机框架搭载雷帕霉素|科研试剂

Configure stylelint

Eight sorts
![[clean up the extraordinary image of Disk C]](/img/0d/331115bc5d82d6337ae975a08494b2.jpg)
[clean up the extraordinary image of Disk C]
随机推荐
金属有机骨架材料ZIF-8包载姜黄素([email protected]纳米颗粒)|纳米金属有机框架搭载雷帕霉素|科研试剂
jvm-对象生命周期
天图投资冲刺港股:资产管理规模249亿 投了小红书与奈雪
28:第三章:开发通行证服务:11:在配置文件中定义属性,然后在代码中去获取;
JS new challenges
Understanding of closures
2021年区域赛ICPC沈阳站J-Luggage Lock(代码简洁)
Generate directories from web content
FPGA测试方法以Mentor工具为例
simpleParallax. JS (create poor visual effects for website pictures)
必贝特医药冲刺科创板:年营收97万亏损1.37亿 拟募资20亿
Exercise 10-8 recursive implementation of sequential output of integers
Exercise 9-3 plane vector addition
Uniapp tips - scrolling components
Redis:字符串类型数据的操作命令
MIL-100( Fe) 包裹小分子阿司匹林形成[email protected](Fe)|甘草次酸修饰金属有机框架材料UiO-66-NH2(简称UiO-66-NH2-GA)
关于回溯问题中的排列问题的思考(LeetCode46题与47题)
JS Part III
7-9 find a small ball with a balance
JS Part 2