From 0483722d9a7d1262bbc6b56fff7c9bbc5fb277b7 Mon Sep 17 00:00:00 2001 From: danielcw Date: Thu, 20 Jul 2017 13:34:48 +0800 Subject: [PATCH] ssss --- 2017-I.S.Trump-danielcw.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 2017-I.S.Trump-danielcw.js diff --git a/2017-I.S.Trump-danielcw.js b/2017-I.S.Trump-danielcw.js new file mode 100644 index 0000000..69c4942 --- /dev/null +++ b/2017-I.S.Trump-danielcw.js @@ -0,0 +1,28 @@ +function getBMI(height,weight){ +return weight/(Math.pow(height,2))*10000 +} +function getMessage(height,weight){ + var out=getBMI(height,weight) +if(out>=35){ + return ("重大肥胖") +}else if(out>=30){ + return ("中度肥胖") + +}else if(out>=27){ + return ("輕度肥胖") + +}else if(out>=24){ + return ("過重") +}else if(out>=18,5){ + + return ("正常範圍") +}else{ + return ("體重過輕") +} + +return (out>=35?"重大肥胖":(out>=30)?"中度肥胖":(out>=27)?"輕度肥胖":(out>=24)?"過重":(out>=18.5)?"正常範圍":"體重過輕") +} +console.log(getBMI(175,72)) + +console.log(getMessage(175,60)) +