当前位置:网站首页>[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);

边栏推荐
- web254
- [R language] two /n data merge functions
- Kickback -- find the first palindrome character in a group of characters
- LM08丨网格系列之网格反转(精)
- base64
- 软件测试方法和技术 - 基础知识概括
- [website architecture] solve 90% of distributed transactions in one move, and introduce the working principles and application scenarios of database transactions and distributed transactions
- 【入门】提取不重复的整数
- How do the top ten securities firms open accounts? In addition, is it safe to open a mobile account?
- Huawei modelarts training alexnet model
猜你喜欢

The database is locked. Is there a solution

Day5: scanner object, next() and nextline(), sequential structure, selection structure, circular structure

PWN attack and defense world int_ overflow

Android screen adaptation (using constraintlayout), kotlin array sorting

【mysql学习笔记25】sql语句优化
![[website architecture] solve 90% of distributed transactions in one move, and introduce the working principles and application scenarios of database transactions and distributed transactions](/img/2c/07d729d49b1d74553decac4588074e.png)
[website architecture] solve 90% of distributed transactions in one move, and introduce the working principles and application scenarios of database transactions and distributed transactions
![[MySQL learning notes 25] SQL statement optimization](/img/01/cf0556961670bb43512caab8d5f4e5.png)
[MySQL learning notes 25] SQL statement optimization

Inftnews | from "avalanche" to Baidu "xirang", 16 major events of the meta universe in 30 years

下载Xshell和Xftp

【批处理DOS-CMD-汇总】扩展变量-延迟变量cmd /v:on、cmd /v:off、setlocal enabledelayedexpansion、DisableDelayedExpansion
随机推荐
sqlalchemy创建MySQL_Table
2022 tea master (intermediate) recurrent training question bank and answers
下载Xshell和Xftp
php laravel微信支付
软件测试方法和技术 - 基础知识概括
The Windows C disk is full
getInputStream() has already been called for this request
window c盘满了
How to get a SharePoint online site created using the office365 group template
Li Kou daily question - day 31 -1502 Judge whether an arithmetic sequence can be formed
LM08丨网格系列之网格反转(精)
凸印的印刷原理及工艺介绍
MATLAB之基础知识
How to check ad user information?
【mysql学习笔记26】视图
kubernetes资源对象介绍及常用命令(二)
H5 页面设置了字体的粗细样式,但是在华为手机里微信打开访问样式不生效?
良心安利万向轮 SolidWorks模型素材网站
5大组合拳,解决校园6大难题,护航教育信息化建设
Principle and process of embossing