打印正三角♥
for (let i = 1; i <= 20; i++) {
for (let u = i; u <= 20; u++) {
document.write(` `)
}
for (let j = 1; j <= i; j++) {
document.write(`♥`)
}
document.write(`<br>`)
}
打印倒立三角♥
for (let i = 1; i <= 20; i++) {
for (let u = 20 - i; u <= 20; u++) {
document.write(` `)
}
for (let j = 20 - i; j >= 0; j--) {
document.write(`♥`)
}
document.write(`<br>`)
}