#P5714. 【深基3.例7】肥胖问题
【深基3.例7】肥胖问题
Problem Description
The BMI index is an international standard commonly used to measure whether a person is underweight or overweight. It is calculated as , where is the weight (in kilograms) and is the height (in meters). The ranges and results are as follows:
- Less than : underweight, output
Underweight; - Greater than or equal to and less than : normal weight, output
Normal; - Greater than or equal to : overweight. You must output the BMI value first (using the default precision of
cout), then output a newline, and then outputOverweight.
Given the weight and height, you need to determine the body type based on the BMI index and output the corresponding result.
For non-C++ languages, when outputting, please round to six significant digits. If the decimal part has trailing 's, do not output those trailing 's.
Note that keeping six significant digits is not the same as keeping six decimal places. For example, should be output as , and should be output as .
Input Format
A single line.
The first line contains floating-point numbers , representing the weight (in kg) and the height (in m), respectively.
Output Format
Output one string on one line, representing the BMI-based result. In particular, for the special handling of the Overweight case, refer to the statement above.
70 1.72
Normal
100 1.68
35.4308
Overweight
Hint
Constraints: For all data, , . There are at most three digits after the decimal point in and .
Translated by ChatGPT 5