当前位置:网站首页>P5714 [deep foundation 3. Case 7] obesity
P5714 [deep foundation 3. Case 7] obesity
2022-07-29 04:54:00 【Chen Yuchen】
BMI The index is a standard commonly used internationally to measure the degree of obesity and thinness of the human body , The algorithm is m/h^2
(40≤m≤120,1.4≤h≤2.0), among mm It refers to weight ( kg ),hh Refers to height ( rice ). The range and judgment results of different body types are as follows :
Less than 18.5: Underweight , Output Underweight;
Greater than or equal to 18.5 And less than 24: Normal weight , Output Normal;
Greater than or equal to 24: obesity , Not only output BMI value ( Use cout The default precision of ), And then line break , And output Overweight;
Now give weight and height data , Need basis BMI The index judges the shape state and outputs the corresponding judgment .
For non C++ Language , At output time , Please round Retain six significant digital outputs , If there is a suffix in the decimal part 00, Do not output suffixes 00.
Please note that , Keeping six significant digits is not keeping six decimal places . for example 114.5149114.5149 The output should be 114.515114.515,9198.109198.10 The output should be 9198.19198.1.
Input format
All in one line .
first line , common 22 A floating point number ,m,nm,n, Weight respectively ( Unit is kgkg), height ( Unit is mm).
Output format
nothing
I/o sample
Input #1 Copy
70 1.72
Output #1 Copy
Normal
explain / Tips
m and h Not more than 3 Decimal place
// How many bits of valid data are reserved
import java.math.*;
import java.util.*;
public class Main{
public static void main(String [] args){
Scanner sc = new Scanner(System.in);
int m = sc.nextInt();
double h = sc.nextDouble();
double sum = m/(Math.pow(h,2));
// Use BigDecimal Medium divide Method for trade-offs
BigDecimal result = new BigDecimal(String.valueOf(sum));
BigDecimal divi = BigDecimal.ONE;
MathContext mc = new MathContext(6);
if(sum<18.5){
System.out.println("Underweight");
}else if(sum>=18.5&&sum<24){
System.out.println("Normal");
}else{
System.out.println(result.divide(divi,mc));
System.out.println("Overweight");
}
}
}
边栏推荐
- Glory 2023 push, push code ambubk
- leetcode 763. Partition Labels 划分字母区间(中等)
- 荣耀2023内推,内推码ambubk
- EF Core: 一对一,多对多的配置
- Mysql:the user specified as a definer ('root '@'%) does not exist
- Five correlation analysis, one of the most important skills of data analysts
- Go memory model for concurrency
- After the spinning up installation is completed, use the tutorial to test whether it is successful. There are library "Glu" not found and 'from pyglet.gl import * error solutions
- excel怎么设置行高和列宽?excel设置行高和列宽的方法
- The most comprehensive promotion plan for the launch of new products
猜你喜欢

Mysql各版本下载地址及多版本共存安装

Un7.28: common commands of redis client.

ios面试准备 - 网络篇

Recommendation system of online education

SGuard64.exe ACE-Guard Client EXE:造成磁盘经常读写,游戏卡顿,及解决方案

img 响应式图片的实现(含srcset属性、sizes属性的使用方法,设备像素比详解)

Stack and queue and priority queue (large heap and small heap) simulation implementation and explanation of imitation function

Opencv learning 1 (environment configuration)

Word如何查看文档修改痕迹?Word查看文档修改痕迹的方法

Reveal installation configuration debugging
随机推荐
C语言实现三子棋
How is the entered query SQL statement executed?
【无标题】
命令行交互工具(最新版) inquirer 实用教程
Use more flexible and convenient Rogowski coil
PHP determines whether the user has logged in. If logged in, the home page will be displayed. If not, enter the login page or registration page
Deep analysis of data storage in memory (Advanced C language)
Download addresses of various versions of MySQL and multi version coexistence installation
MySQL regularly calls preset functions to complete data update
Mujoco and mujoco_ Install libxcursor.so 1:NO such dictionary
新产品上市最全推广方案
pulsar起client客户端时(client,producer,consumer)各个配置
[c language] PTA 7-63 falling ball
RecyclerView通过DPAD按键上下切换焦点 切换到界面外的控件时焦点会左右乱跳
spinning up安装完使用教程测试是否成功,出现Library“GLU“ not found和‘from pyglet.gl import *错误解决办法
Go面向并发的内存模型
安装spinning up教程里与mujoco对应的gym,报错mjpro150
UE plays video in scene or UMG
盒子水平垂直居中布局(总结)
Reveal installation configuration debugging