题解 | #衡量人体胖瘦程度#
衡量人体胖瘦程度
https://www.nowcoder.com/practice/4d604603fae94a26b59b7bc18f363bc0
#include <stdio.h>
int main() {
double w = 0;
double h = 0;
double BIM = 0;
while (scanf("%lf %lf", &w, &h) != EOF)
{
h = h / 100;
BIM = w / (h*h);
if(BIM < 18.5)
{
printf("Underweight\n");
}
else if(BIM >= 18.5 && BIM <= 23.9)
{
printf("Normal\n");
}
else if(BIM > 23.9 && BIM <= 27.9)
{
printf("Overweight\n");
}
else
{
printf("Obese\n");
}
}
return 0;
}
