# -*- coding:utf-8 -*-
height=input('身高(m):')
height=float(height)
weight=input('体重(kg):')
weight=float(weight)
BMI=weight/height**2
if BMI<18.5:
print('BMI=',BMI,',过轻')
elif BMI<=25:
print('BMI=',BMI,',正常')
elif BMI<=28:
print('BMI=',BMI,',过重')
elif BMI<=32:
print('BMI=',BMI,',肥胖')
else:
print('BMI=',BMI,',严重肥胖')
Sign in to make a reply
無淣
# -*- coding:utf-8 -*-
height=input('身高(m):')
height=float(height)
weight=input('体重(kg):')
weight=float(weight)
BMI=weight/height**2
if BMI<18.5:
print('BMI=',BMI,',过轻')
elif BMI<=25:
print('BMI=',BMI,',正常')
elif BMI<=28:
print('BMI=',BMI,',过重')
elif BMI<=32:
print('BMI=',BMI,',肥胖')
else:
print('BMI=',BMI,',严重肥胖')