# [Algorithm/JS] ๋ฐฑ์ค€ 2438๋ฒˆ ๋ณ„์ฐ๊ธฐ-1

๐Ÿ”— ๋ฌธ์ œ ๋ฐ”๋กœ๊ฐ€๊ธฐ (opens new window)

# Question

์ฒซ์งธ ์ค„์—๋Š” ๋ณ„ 1๊ฐœ, ๋‘˜์งธ ์ค„์—๋Š” ๋ณ„ 2๊ฐœ, N๋ฒˆ์งธ ์ค„์—๋Š” ๋ณ„ N๊ฐœ๋ฅผ ์ฐ๋Š” ๋ฌธ์ œ

# Input

์ฒซ์งธ ์ค„์— N(1 โ‰ค N โ‰ค 100)์ด ์ฃผ์–ด์ง„๋‹ค.

# Output

์ฒซ์งธ ์ค„๋ถ€ํ„ฐ N๋ฒˆ์งธ ์ค„๊นŒ์ง€ ์ฐจ๋ก€๋Œ€๋กœ ๋ณ„์„ ์ถœ๋ ฅํ•œ๋‹ค.

# Example

# Input

5
1

# Output

*
**
***
****
*****
1
2
3
4
5

# Solution

const input = require('fs').readFileSync('dev/stdin').toString();
let star = '';
let result = '';
for (let i = 1; i <= Number(input); i++) {
  star += `*`;
  result += star + '\n';
}
console.log(result);
1
2
3
4
5
6
7
8
Last Updated: 2022. 6. 5. ์˜คํ›„ 3:42:39