๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

ํ”„์—” ๊ณต๋ถ€/๐Ÿซง ์•Œ๊ณ ๋ฆฌ์ฆ˜ ๊ณต๋ถ€

[๋ฐฑ์ค€/Node.js] 25314๋ฒˆ ํ’€์ด || JavaScript

728x90
let input = require('fs').readFileSync('/dev/stdin').toString().split(" ");
const quantityOf4 = +input[0] / 4;

let board = "";
for (let i = 0; i < quantityOf4; i++) {
    board = `${board} long`;
}
console.log(board.trim(), "int");

๐Ÿ“Œ ๊ณต๋ฐฑ์ด ๋‚˜์˜ค๋Š” ๋ถ€๋ถ„์€ trim() ํ•จ์ˆ˜๋กœ ์ž˜๋ผ๋‚ธ ํ›„ ๋์— int ๋ฅผ ๊ฐ™์ด ์ถœ๋ ฅํ–ˆ๋‹ค.

728x90
๋ฐ˜์‘ํ˜•