当前位置:网站首页>[introduction] approximate value
[introduction] approximate value
2022-07-01 07:59:00 【-Heaven rewards diligence-】
describe
Write a program , Accept a positive floating point number , Output the approximate integer value of this value . If the value after the decimal point is greater than or equal to 0.5 , Rounding up ; Less than 0.5 , Then round down .
Data range : Make sure that the number entered is in 32 Bit floating point number range
Input description
Enter a positive floating point number
Output description
Output the approximate integer value of this value
Example 1
Input :5.5
Output :6
explain :0.5>=0.5, therefore 5.5 Need to round up to 6
Example 2
Input :2.499
Output :2
explain :0.499<0.5,2.499 Round down to 2
<?php
fscanf(STDIN, "%f", $a);
echo round($a,0);
边栏推荐
- Download xshell and xftp
- 力扣每日一题-第31天-1790.仅执行一次字符串交换能否使两个字符串相等
- Introduction to kubernetes resource objects and common commands (II)
- Access report realizes subtotal function
- Redisson watchdog mechanism, redisson watchdog performance problems, redisson source code analysis
- Principle and process of embossing
- [untitled]
- Eigen矩阵运算库快速上手
- Li Kou daily question - day 31 -202 Happy number
- [MySQL learning notes 28] storage function
猜你喜欢
The database is locked. Is there a solution
Gdip - hatchBrush图案表
Wang Yingqi, founder of ones, talks to fortune (Chinese version): is there any excellent software in China?
web254
Caesar
Access报表实现小计功能
SharePoint - how to quickly check whether SharePoint is standard or enterprise edition?
Discussion on several research hotspots of cvpr2022
【批处理DOS-CMD命令-汇总和小结】-Cmd窗口中常用操作符(<、<<、&<、>、>>、&>、&、&&、||、|、()、;、@)
Android screen adaptation (using constraintlayout), kotlin array sorting
随机推荐
PHP laravel wechat payment
Microsoft stream - how to modify video subtitles
Gdip - hatchBrush图案表
2022 test question bank and simulation test of tea master (primary) operation certificate
Implementation and encapsulation of go universal dynamic retry mechanism
uni 热更新
Conscience Amway universal wheel SolidWorks model material website
LSTM of RNN
Inftnews | from "avalanche" to Baidu "xirang", 16 major events of the meta universe in 30 years
How relational databases work
[MySQL learning notes 28] storage function
Caesar
Basic number theory -- combinatorial number
Sorting out tcp/udp communication problems
2022 mobile crane driver test exercises and online simulation test
Office365 - how to use stream app to watch offline files at any time
【入门】输入n个整数,输出其中最小的k个
Aardio - Method of self constructed geticonhandle
Access report realizes subtotal function
2022 tea master (intermediate) recurrent training question bank and answers