λ°μν
π readline
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
rl.on("line", (line) => {
// ν μ€μ© μ
λ ₯λ°μ ν μ€νν μ½λ
rl.close(); // νμ. μμΌλ©΄ μ
λ ₯μ 무νν λ°λλ€
});
rl.on("close", () => {
process.exit(); // μ
λ ₯μ΄ λλ ν μ€νν μ½λ
});
π (node.js) fs - λ°±μ€ μκ°μ ν ζ λ¬Έμ νμ΄μ©
// ν μ€ μ
λ ₯
let input = require("fs").readFileSync("/dev/stdin").toString();
// μ¬λ¬ μ€ μ
λ ₯
let input = require("fs").readFileSync("/dev/stdin").toString().split("\n");
λ°μν
'Training > Problem Solving' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
[JS] λ°°μ΄ μμλ€μ λͺ¨λ μ‘°ν©(Combinations) ꡬνκΈ° (0) | 2022.05.04 |
---|---|
[JS] μμ νλ³νκΈ° (0) | 2022.05.04 |
[C++] λ¬Έμμ΄ κ³΅λ°± κΈ°μ€μΌλ‘ μλ₯΄κΈ° (string split) (0) | 2022.01.01 |