File tree Expand file tree Collapse file tree 2 files changed +91
-0
lines changed Expand file tree Collapse file tree 2 files changed +91
-0
lines changed Original file line number Diff line number Diff line change
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 >
Original file line number Diff line number Diff line change
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 >
You can’t perform that action at this time.
0 commit comments