-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforRepeat.html
More file actions
44 lines (38 loc) · 918 Bytes
/
forRepeat.html
File metadata and controls
44 lines (38 loc) · 918 Bytes
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<script>
/*
왼쪽 기준 별 찍기
// const a = "*";
let blank = "";
for (let i = 1; i < 10; i++) {
for (let j = 0; j < i; j++) {
blank += "*";
}
document.write(`${blank} `);
document.write("<br>");
blank = "";
}*/
let blank = ''
//14
// ' '공백 작동 안되서  로 대체
for (let i = 1; i < 15; i++) {
for (let j = 15; j > i; j--) {
blank += ' '
}
for(let k = 0; k<2*i-1;k++){
blank +="*"
}
document.write(`${blank}`)
document.write("<br>")
blank = ''
}
</script>
</body>
</html>