Algorithm
- ์๊ทผ์ด์ ์น๊ตฌ๋ค -
๋ฌธ์
์๊ทผ์ด์ ๋จ์ ์น๊ตฌ์ ์์ ์ฌ์ ์น๊ตฌ์ ์๊ฐ ์ฃผ์ด์ก์ ๋, ์น๊ตฌ๋ ์ด ๋ช ๋ช ์ธ์ง ๊ตฌํ๋ ํ๋ก๊ทธ๋จ์ ์์ฑํ์์ค.
์ ์ถ๋ ฅ ์์
๋ฌธ์ ํ๊ธฐ
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
let input = [];
let result = [];
rl.on("line", function (line) {
input.push(line.toString());
}).on("close", function () {
input = input.map((el) => el.split(" ").map((el) => Number(el)));
for (let i = 0; i < input.length - 1; i++) {
result.push(input[i][0] + input[i][1]);
}
console.log(result.join("\n"));
process.exit();
});
๋ฐ์ํ
'๊ฐ์ธ๊ณต๋ถ > Algorithm' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค][Node.js] 6064๋ฒ : ์นด์ ๋ฌ๋ ฅ (0) | 2021.12.02 |
---|---|
[๋ฐฑ์ค][Node.js] 5988๋ฒ : ํ์์ผ๊น ์ง์์ผ๊น (0) | 2021.12.01 |
[๋ฐฑ์ค][Node.js] 5622๋ฒ : ๋ค์ด์ผ (0) | 2021.11.29 |
[๋ฐฑ์ค][Node.js] 5598๋ฒ : ์นด์ด์ฌ๋ฅด ์ํธ (0) | 2021.11.28 |
[๋ฐฑ์ค][Node.js] 5597๋ฒ : ๊ณผ์ ์ ๋ด์ ๋ถ..? (0) | 2021.11.27 |
๋๊ธ