Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
minghe-cwrs authored Oct 1, 2024
1 parent fbda6fa commit e6d1a10
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions BMIC.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
while True:

w = input("输入体重[千克/公斤]\n[local]~#")
print()
h = input("输入身高[米]\n(带小数点)\n[local]~#:")
w = float(w)
h = float(h)
ht = h*h
ht = float(ht)
bmi = w/ht
bmi = str(bmi)
print()
print("您的BMI为:" + bmi)
print()
bmi = float(bmi)
w = float(input("输入体重[千克/公斤]\n[local]~#"))
h = float(input("\n输入身高[米]\n(带小数点)\n[local]~#:"))
bmi = w/(h**2)
print("\n您的BMI为:" + str(bmi) + "\n")

if bmi < 18.5:
print("您的体重偏轻!")
Expand All @@ -33,5 +23,4 @@
print("您这...")
print("赶紧打电话咨询营养师吧!")

print()
input("程序到此结束,按任意键继续!\n(程序会不停循环 直到您关掉为止)")
input("\n程序到此结束,按任意键继续!\n(程序会不停循环 直到您关掉为止)")

0 comments on commit e6d1a10

Please sign in to comment.