衡量人体胖瘦程度

126 阅读1分钟

image.png

描述
在计算BMI(BodyMassIndex ,身体质量指数)的案例基础上,判断人体胖瘦程度。BMI中国标准如下表所示。

输入描述:
多组输入,每一行包括两个整数,用空格隔开,分别为体重(公斤)和身高(厘米)。
输出描述:
针对每行输入,输出为一行,人体胖瘦程度,即分类。

image.png

while True:
    try:
        weight,height=list(map(int,input().split(" ")))[0:2]
        BMI=weight/(height/100)/(height/100)
        if BMI<18.5:
            print("Underweight")
        elif 18.5<=BMI<=23.9:
            print("Normal")
        elif 23.9<=BMI<=27.9:
            print("Overweight")
        else:
            print("Obese")
    except:
        break