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

ํ”„์—” ๊ณต๋ถ€

(151)
[๋ฐฑ์ค€/Node.js] 10951๋ฒˆ ํ’€์ด || JavaScript let input = require('fs').readFileSync('/dev/stdin').toString().trim().split("\n"); for (let i = 0; i
[๋ฐฑ์ค€/Node.js] 10952๋ฒˆ ํ’€์ด || JavaScript let input = require('fs').readFileSync('/dev/stdin').toString().split("\n"); const loop = Number(input.length - 1); let numbers = ""; for (let i = 0; i Number(n)); if (numbers[0] !== 0) { console.log(numbers[0] + numbers[1])}; } ๐Ÿฅ• ๋‹จ์ˆœํ•œ ๊ฒƒ ๊ฐ™์€๋ฐ ํ’€๋ฉด์„œ ๊นŒ๋‹ค๋กญ๋‹ค๊ณ  ๋Š๊ผˆ๋‹ค. ์ฃผ์–ด์ง€๋Š” ์ˆซ์ž A, ์™€ B์˜ ์กฐ๊ฑด์„ ์ œ๋Œ€๋กœ ์•ˆ๋ด์„œ.. A๋Š” > 0 ์ด๋‹ˆ, ์กฐ๊ฑด์— ๋ฐ˜ํ•˜๋Š” ์ˆซ์ž๊ฐ€ ๋“ค์–ด์˜ค๋ฉด ์ถœ๋ ฅํ•˜์ง€ ์•Š๋Š” ๊ฑธ ์ƒ๊ฐ์„ ๋ชปํ–ˆ์—ˆ๋‹ค. ๊ทธ๋ž˜์„œ while๋ฌธ๋„ ํ–ˆ๋‹ค๊ฐ€ for๋ฌธ๋„ ํ–ˆ๋‹ค๊ฐ€ ํ•˜๋Š”๋ฐ ๋„์ €ํžˆ ๋ฒ”์œ„๊ฐ€ ์•ˆ์žกํžˆ๋Š” ๋Š๋‚Œ์ด ๋“ค์—ˆ๋‹ค... ๐Ÿฅ• loop์˜ ๊ธธ์ด..
[๋ฐฑ์ค€/Node.js] 2439๋ฒˆ ํ’€์ด || JavaScript let input = require('fs').readFileSync('/dev/stdin').toString().split("\n"); const loop = +input[0]; let stars = ""; for (i = 1; i
[๋ฐฑ์ค€/Node.js] 2438๋ฒˆ ํ’€์ด || JavaScript let input = require('fs').readFileSync('/dev/stdin').toString().split("\n"); const loop = +input[0]; for (i = 1; i
[๋ฐฑ์ค€/Node.js] 11021, 11022๋ฒˆ ํ’€์ด || JavaScript #11021 let input = require('fs').readFileSync('/dev/stdin').toString().split("\n"); const loop = +input[0]; for (i = 1; i Number๋กœ ํƒ€์ž… ๋ณ€ํ™˜ ํ›„ ๋”ํ•ด์ค€ ๊ฐ’์„ ํ•˜๋‚˜์”ฉ ์ถœ๋ ฅ๋˜๊ฒŒ ํ•ด์ค€๋‹ค. #11022 for (i = 1; i
[๋ฐฑ์ค€/Node.js] 15552๋ฒˆ ํ’€์ด || JavaScript let input = require('fs').readFileSync('/dev/stdin').toString().split("\n"); const loop = +input[0]; let numArray = ""; for (i = 1; i
[๋ฐฑ์ค€/Node.js] 25314๋ฒˆ ํ’€์ด || JavaScript 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 ๋ฅผ ๊ฐ™์ด ์ถœ๋ ฅํ–ˆ๋‹ค.
[๋ฐฑ์ค€/Node.js] 25304๋ฒˆ ํ’€์ด || JavaScript let input = require('fs').readFileSync('/dev/stdin').toString().split("\n"); const sum = +input[0]; const kinds = +input[1]; let itemPrice = 0; for (let i = 2; i

728x90
๋ฐ˜์‘ํ˜•