衡量人胖瘦程度_python3

衡量人体胖瘦程度

http://www.nowcoder.com/questionTerminal/4d604603fae94a26b59b7bc18f363bc0

def getBMI(weight, height):
    BMI = weight/((height/100)**2)
    if BMI < 18.5:
        print('Underweight')
    elif BMI >= 18.5 and BMI <= 23.9:
        print('Normal')
    elif BMI > 23.9 and BMI <= 27.9:
        print('Overweight')
    else: 
        print('Obese')

while True:
    try:
        weight, height = map(int, input().split())
        getBMI(weight, height)
    except EOFError:
        break
全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务