-
Notifications
You must be signed in to change notification settings - Fork 0
/
38-打印99乘法表.html
48 lines (44 loc) · 1.15 KB
/
38-打印99乘法表.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
span {
display: inline-block;
padding: 5px 10px;
border: 1px solid pink;
margin: 2px;
border-radius: 5px;
box-shadow: 2px 2px 2px pink;
}
input {
display: inline-block;
padding: 5px 10px;
border: 1px solid pink;
margin: 2px;
border-radius: 5px;
box-shadow: 2px 2px 2px pink;
}
</style>
</head>
<body>
<script>
for (let i = 1; i <= 9; i++) {
for (let j = 1; j <= i; j++) {
document.write(`<span>${j} x ${i} = ${i*j}</span>`)
}
document.write(`<br>`)
}
let arr = [2, 4, 6, 9.1]
let avg = 0
for (let i = 0; i < arr.length; i++) {
avg += arr[i]
}
avg = avg / arr.length
document.write(`<span>${avg}</span>`)
</script>
<input type="button" value="保存">
</body>
</html>