목록문자열 반복해서 출력하기 (1)
🤍 은지log 🤍
![](http://i1.daumcdn.net/thumb/C150x150.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/ckDkJ1/btsGyS7F3JO/jTiGEQ4pkYdYKI3MkB5GL0/img.png)
프로그래머스 Lv.0 - 문자열 반복해서 출력하기 💚 문제설명 💚 제한조건 1 ≤ str의 길이 ≤ 10 1 ≤ n ≤ 5 💚 풀이 const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); let input = []; rl.on('line', function (line) { input = line.split(' '); }).on('close', function () { str = input[0]; n = Number(input[1]); console.log(str.repeat(n)) }); ✅ repeat( )메서드로 str을 n번만큼 반복..
🌈 프로그래머스
2024. 4. 11. 16:23