当前位置:网站首页>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);
}边栏推荐
- Cross linked cyclodextrin metal organic framework loaded methotrexate slow-release particles | metal organic porous material uio-66 loaded with flavonoid glycosides | Qiyue
- Programmable logic device software testing
- simpleParallax. JS (create poor visual effects for website pictures)
- Page generation QR code
- 交联环糊精金属有机骨架负载甲氨蝶呤缓释微粒|金属-有机多孔材料UiO-66负载黄酮苷类药物|齐岳
- Exercise 6-1 classify and count the number of characters
- MongoDB索引
- 全局事件总线
- 可编程逻辑器件软件测试
- 好看、好用、强大的手写笔记软件综合评测:Notability、GoodNotes、MarginNote、随手写、Notes Writers、CollaNote、CollaNote、Prodrafts、Noteshelf、FlowUs、OneNote、苹果备忘录
猜你喜欢

Print. JS -- web page file printing

Understanding of closures

Scroll detection of the navigation bar enables the navigation bar to slide and fix with no content

jvm-类加载

x86汇编语言-从实模式到保护模式 笔记

【吉林大学】考研初试复试资料分享

常见问题之PHP——ldap_add(): Add: Undefined attribute type in

Exercise 8-8 moving letters

Exercise 6-2 using functions to sum special A-string sequences

Exercise 10-3 recursive implementation of exponential functions
随机推荐
JS continues to explore...
selenium 浏览器(1)
1px problem of mobile terminal
关于回溯问题中的排列问题的思考(LeetCode46题与47题)
小项目(servelt+jsp+mysql+EL+JSTL)完成一个登录功能的Servlet,具有增删改查的操作。实现登录身份验证,防止非法登录,防止多点登录,记住用户名密码功能。
Uniapp tips - scrolling components
JS get DPI, PX to cm, cm to PX
Scroll detection of the navigation bar enables the navigation bar to slide and fix with no content
Canvas utility library fabric JS user manual
How to delete an attribute or method of an object
QT learning 21 standard dialog box in QT (Part 2)
7-9 find a small ball with a balance
Nucleic acid modified metal organic framework drug carrier | pcn-223 metal organic framework encapsulated ad adamantane | zif-8 encapsulated adriamycin (DOX)
Although not necessarily the best, it must be the hardest!
Fabric. JS document
Exercise 6-1 classify and count the number of characters
Exercise 9-3 plane vector addition
交联环糊精金属有机骨架负载甲氨蝶呤缓释微粒|金属-有机多孔材料UiO-66负载黄酮苷类药物|齐岳
28:第三章:开发通行证服务:11:在配置文件中定义属性,然后在代码中去获取;
别再问自己适不适合做软件测试了