圣诞树


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
<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title>圣诞树</title>
<style>
body {
margin: 20px;
color:
line-height: 30px;
font-size: 50px;
}
</style>
</head>

<body>
<script>
var h = 15
for(i = 1; i <= h - 1; i++) {
for(j = h - 1; j >= i; j--) {
document.write('&nbsp;')
}
for(n = 1; n <= 2 * i - 1; n++) {
document.write('*')
}
document.write('<br>')
}
</script>
</body>

</html>