w = float(input('请输入体重:'))
h = float(input('请输入身高:'))
MBI = w/(h*h)
# print(format(MBI, '.0f'))
if MBI > 32:
print('%.1f严重肥胖' % MBI)
elif MBI > 28:
print('肥胖{0:.1f}'.format(MBI))
elif MBI > 25:
print(f'过重{MBI:.1f}')
elif float(MBI) > 18.5:
print('正常')
else :
print('过轻')
print('BMI指数是',MBI)
Sign in to make a reply
嗯咦啊哦
w = float(input('请输入体重:'))
h = float(input('请输入身高:'))
MBI = w/(h*h)
# print(format(MBI, '.0f'))
if MBI > 32:
print('%.1f严重肥胖' % MBI)
elif MBI > 28:
print('肥胖{0:.1f}'.format(MBI))
elif MBI > 25:
print(f'过重{MBI:.1f}')
elif float(MBI) > 18.5:
print('正常')
else :
print('过轻')
print('BMI指数是',MBI)