163 字
约 32 秒
9
双分支解决,不好阅读
2026-09-26
无标签
score = 98
if score > 98:
print('A')
elif score > 80 and score < 98:
print('B')
elif score > 70 and score< 80:
print('C')
else:
print('D')
双分支解决,不好阅读
if score > 90:
print('A')
else:
if score > 80:
print('B')
else:
if score > 70:
print('C')
else:
print('D')
单分支
if score > 90:
print('A')
if score > 80 and score <= 90:
print('B')
if score > 70 and score <= 80:
print('C')
if score <= 70:
print('D')
#bmi计算
#bmi = w/(h*h)
w = float(input('请输入你的体重,单位kg:'))
h = float(input('请输入你的身高,单位米:'))
bmi = w / (h * h)
print(bmi)
if bmi < 18.5:
print('多吃一点才健康')
elif bmi < 23.9:
print('你的体型非常的标准')
else:
print('运动运动更健康')
评论
0 条
还没有评论,先写一条吧。