当前位置:网站首页>Luogu p5707 [deep foundation 2. example 12] late for school
Luogu p5707 [deep foundation 2. example 12] late for school
2022-06-25 14:50:00 【䨁 逦】
Title Description
yyy Our school requires that in the morning 8 We'll be there by two o'clock . School to yyy There are... In my family s(s\le 10000)s(s≤10000) rice , and yyy We can use v(v<10000)v(v<10000) Walk to school at a constant speed of meters per minute . Besides, it has to spend extra money on the way to school 10 Minutes for garbage sorting . Excuse me, in order to avoid being late yyy When is the latest time to go out ? Output HH:MM Time format of , Fill in zero if there are less than two digits . Because it's a long way , yyy You may have to start a day earlier , But it can't be more than a day in advance .
Input format
Two positive integers s,v, The meaning has been given in the title .
Output format
hh:mm The latest time to leave home ( when : branch , Two digits must be output , Fill in the front of less than two 0)
I/o sample
Input #1 Copy
100 99
Output #1 Copy
07:48
C Language version ,
There are several test points that can not pass when writing the questions , Then I looked carefully and found that C The problem and complement of wide language domain 0 The problem of
use printf() Function must be complemented by lines 0 The operation can be written as follows printf("%02d",n); The non-zero digit part can be changed .
Here is AC Code
#include<stdio.h>
#include<math.h>
int main()
{
int n=0,v=0,t=0,s=0;
scanf("%d %d",&s,&v);
if(s%v==0) { t=s/v+10;}
else t=s/v+11;
if(t<=8*60)
{
int h=0,m=0;
t=8*60-t;
h=t/60;
m=t%60;
printf("%02d:%02d",h,m);
}
else
{
int h=0,m=0;
t=32*60-t;
h=t/60;
m=t%60;
printf("%02d:%02d",h,m);
}
return 0;
}
边栏推荐
- Deploy eve-ng with KVM virtualization
- Ideal L9 in the eyes of the post-90s: the simplest product philosophy, creating the most popular products
- Two methods to rollback the code in pycharm to the specified version (with screenshot)
- Let and const commands
- JS to verify whether the string is a regular expression
- Kubernetes 理解kubectl/调试
- 分享自己平時使用的socket多客戶端通信的代碼技術點和軟件使用
- Clinical Chemistry | 张建中/徐健开发幽门螺杆菌单细胞精准诊疗技术
- Native JS obtains form data and highlights and beautifies JSON output display
- Report on Hezhou air32f103cbt6 development board
猜你喜欢

Kubernetes understands kubectl/ debugging

About the problem of kicad stuck in win10 version, version 6 x

Page 112 machine learning - review of fundamentals of mathematics pptx

Variables, scopes, and variable promotion

Power automatic test system nsat-8000, accurate, high-speed and reliable power test equipment

How to cut the size of a moving picture? Try this online photo cropping tool

Using Sphinx to automatically generate API documents from py source files

Thymeleaf Usage Summary

JS floating point multiplication and division method can not accurately calculate the problem

15 -- k points closest to the origin
随机推荐
Mutationobserver listens for DOM changes
Use Matplotlib to draw a line chart
Renix perf: detailed explanation of IP network performance test tools and test case parameters
有哪个瞬间让你觉得这个世界出bug了?
Share the code technology points and software usage of socket multi client communication
15 -- k points closest to the origin
In 2022, the score line of Guangdong college entrance examination was released, and several families were happy and several worried
Output 0 ~ n digits and output multiple times
C language LNK2019 unresolved external symbols_ Main error
The best screenshot tool in the world, color absorption tool snipaste
让PyTorch训练速度更快,你需要掌握这17种方法
New good friend Pinia, leading the new era of state management
Gif动画怎么在线制作?快试试这款gif在线制作工具
For the first time in China, Chinatelecom 5g underground personnel positioning project is officially commercial: it can track the position in real time to ensure operation safety
dev/mapper的解释
HMS Core机器学习服务实现同声传译,支持中英文互译和多种音色语音播报
Application of TSDB in civil aircraft industry
SPARQL learning notes of query, an rrdf query language
Common formatting methods for amount numbers
Does stream even have application advanced learning? As a programmer, you know what