From 21a1879dfbb3a3e08411023921a1f1445870dc0e Mon Sep 17 00:00:00 2001 From: dangdang Date: Thu, 12 Jan 2023 00:41:43 +0900 Subject: [PATCH] =?UTF-8?q?new:=202348.=20=EB=B3=84=EC=B0=8D=EA=B8=B0=20#8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- class01/2348/dangdang.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 class01/2348/dangdang.js diff --git a/class01/2348/dangdang.js b/class01/2348/dangdang.js new file mode 100644 index 0000000..bf7c6e8 --- /dev/null +++ b/class01/2348/dangdang.js @@ -0,0 +1,27 @@ +const readline = require('readline'); + +const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout +}); + +rl.on('line', (line) => { + solution(line); + rl.close(); +}); + +rl.on('close', () => { + process.exit(); +}); + + +function solution(line) { + const number = parseInt(line); + + for (let i = 1; i <= number; i++) { + for (let j = 0; j < i; j++) { + process.stdout.write('*'); + } + process.stdout.write('\n'); + } +} \ No newline at end of file