diff --git a/2017-NUTC-locifer/BMI.js b/2017-NUTC-locifer/BMI.js new file mode 100644 index 0000000..f3bbc9d --- /dev/null +++ b/2017-NUTC-locifer/BMI.js @@ -0,0 +1,22 @@ +/** + * + * @authors 賴麒任 (Locifer) + * @date 2017-07-13 16:33:47 + * @version $0.00$ + */ + +function getBMI(hei, wei) { + var bmi = wei / hei / hei * 10000; + return bmi; +} +var hei = prompt("請輸入你的身高", ""); +var wei = prompt("請輸入你的體重", ""); +var ans = getBMI(hei, wei); +console.log(ans); +if (ans > 24) { + console.log('您的BIM大於24過胖了'); +} else if (ans < 18.5) { + console.log('您的BIM小於18.5過清了'); +} else { + console.log('您的BIM正常'); +} \ No newline at end of file diff --git a/2017-NUTC-locifer/index.html b/2017-NUTC-locifer/index.html new file mode 100644 index 0000000..bf83ad1 --- /dev/null +++ b/2017-NUTC-locifer/index.html @@ -0,0 +1,15 @@ + + +
+ + +