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