Skip to content

Commit edc9582

Browse files
committed
bmi work
1 parent b23f7a1 commit edc9582

File tree

2 files changed

+91
-0
lines changed

2 files changed

+91
-0
lines changed

2017-Kopoa-losevoid/getBmi.html

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!DOCTYPE html>
2+
<html >
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<link rel="shortcut icon" type="image/x-icon" href="https://production-assets.codepen.io/assets/favicon/favicon-8ea04875e70c4b0bb41da869e81236e54394d63638a1ef12fa558a4a835f1164.ico" />
7+
<link rel="mask-icon" type="" href="https://production-assets.codepen.io/assets/favicon/logo-pin-f2d2b6d2c61838f7e76325261b7195c27224080bc099486ddd6dccb469b8e8e6.svg" color="#111" />
8+
<title>CodePen - bmi-test</title>
9+
10+
11+
12+
13+
14+
15+
16+
17+
18+
</head>
19+
20+
<body translate="no" >
21+
22+
23+
24+
25+
<script>
26+
var weight = 70;
27+
var heigh =1.68;
28+
29+
function getBmi(w, h){
30+
return w/(h*h);
31+
}
32+
33+
console.log(getBmi(weight,heigh));
34+
</script>
35+
36+
37+
38+
39+
</body>
40+
</html>

2017-Kopoa-losevoid/getMessage.html

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<html >
2+
3+
<head>
4+
<meta charset="UTF-8">
5+
<link rel="shortcut icon" type="image/x-icon" href="https://production-assets.codepen.io/assets/favicon/favicon-8ea04875e70c4b0bb41da869e81236e54394d63638a1ef12fa558a4a835f1164.ico" />
6+
<link rel="mask-icon" type="" href="https://production-assets.codepen.io/assets/favicon/logo-pin-f2d2b6d2c61838f7e76325261b7195c27224080bc099486ddd6dccb469b8e8e6.svg" color="#111" />
7+
<title>CodePen - getmsg</title>
8+
9+
10+
11+
12+
13+
14+
15+
16+
17+
</head>
18+
19+
<body translate="no" >
20+
21+
22+
23+
24+
<script>
25+
var weight = 55;
26+
var heigh =1.68;
27+
var msg,bmi;
28+
function getMes(w, h){
29+
bmi=w/(h*h);
30+
if(bmi>35)
31+
console.log("重肚肥胖");
32+
else if(bmi>29)
33+
console.log("中度肥胖");
34+
else if(bmi>26)
35+
console.log("輕度防胖");
36+
else if(bmi>23)
37+
console.log("過重");
38+
else if(bmi>18)
39+
console.log("正常");
40+
else
41+
console.log("過瘦");
42+
43+
}
44+
getMes(weight,heigh);
45+
</script>
46+
47+
48+
49+
50+
</body>
51+
</html>

0 commit comments

Comments
 (0)