๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

ํ”„์—” ๊ณต๋ถ€/๐Ÿซง ์•Œ๊ณ ๋ฆฌ์ฆ˜ ๊ณต๋ถ€

[๋ฐฑ์ค€/Node.js] 2438๋ฒˆ ํ’€์ด || JavaScript

728x90
let input = require('fs').readFileSync('/dev/stdin').toString().split("\n");
const loop = +input[0];
for (i = 1; i <= loop; i++) {
    let stars = ""
    for (j = 0; j <= i-1; j++) {
        stars += "*"
    }
    console.log(stars.trim());
}
*
**
***
****
*****

์ฒจ์— ์™œ ํ‹€๋ ธ๋‚˜ ํ–ˆ๋”๋‹ˆ * * * * ์ด๋Ÿฐ์‹์œผ๋กœ ๋„์–ด์“ฐ๊ธฐ ๋˜์–ด์žˆ๋Š” ์ค„ ์•Œ๊ณ  "* " ์ด ๊ฐ’์„ ์ถœ๋ ฅํ•จ. 

"*" ์ด๋ ‡๊ฒŒ ์ถœ๋ ฅํ•ด์•ผํ•จ

728x90
๋ฐ˜์‘ํ˜•