Skip to content

Commit

Permalink
new: 2348. 별찍기 #8
Browse files Browse the repository at this point in the history
  • Loading branch information
PositiveConfident committed Jan 11, 2023
1 parent a209bdc commit 21a1879
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions class01/2348/dangdang.js
Original file line number Diff line number Diff line change
@@ -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');
}
}

0 comments on commit 21a1879

Please sign in to comment.