Created
February 7, 2013 17:40
-
-
Save kaworun/4732661 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
h = io.read(*d) | |
w = io.read(*d) | |
function measurement(w, h) | |
bmi = w / (h * h) | |
print(string.format("%.2f", bmi)) | |
if bmi < 18.5 then | |
print "低体重" | |
elseif 18.5 <= bmi or bmi > 25 then | |
print "普通" | |
elseif 25 <= bmi or bmi > 30then | |
print "肥満 ⅰ" | |
elseif 30 <= bmi or bmi > 35 then | |
print "肥満 ⅱ" | |
elseif 35 <= bmi or bmi > 40 then | |
print "肥満 ⅲ" | |
elseif 40 <= bmi then | |
print "肥満 ⅳ" | |
end | |
end | |
io.write "あなたのBMIは " | |
measurement(w, h) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment