const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
let input = null;
let output = [];
rl.on("line", line => {
input = +line;
output = Array(9)
.fill()
.map((v, i) => i + 1);
rl.close();
}).on("close", () => {
output.forEach(v => console.log(`${input} * ${v} = ${input * v}`));
process.exit();
});
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
let input = [];
let output = null;
let limit = 999;
rl.on("line", line => {
input.push(line);
limit = +input[0];
// 최초 입력한 값만큼만 입력받기
if (limit === input.length - 1) rl.close();
}).on("close", () => {
input = input.filter((v, i) => i !== 0);
input.forEach(v => {
output = v.split(" ");
console.log(+output[0] + +output[1]);
});
process.exit();
});
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
let input = null;
let output = null;
rl.on("line", line => {
input = +line;
output = Array(input)
.fill()
.map((v, i) => i + 1);
rl.close();
}).on("close", () => {
console.log(output.reduce((prev, curr) => prev + curr, 0));
process.exit();
});
매번 출력 X, 한번에 모아서 출력 O
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
let input = [];
let output = null;
let answer = "";
let limit = 999;
rl.on("line", line => {
input.push(line);
limit = +input[0];
// 최초 입력한 값만큼만 입력받기
if (limit === input.length - 1) rl.close();
}).on("close", () => {
input = input.filter((v, i) => i !== 0);
input.forEach(v => {
output = v.split(" ");
answer += +output[0] + +output[1] + "\n";
});
console.log(answer);
process.exit();
});
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
let input = null;
let output = null;
let answer = "";
rl.on("line", line => {
input = +line;
output = Array(input)
.fill()
.map((v, i) => i + 1);
rl.close();
}).on("close", () => {
output.forEach(v => (answer += `${v}\n`));
console.log(answer);
process.exit();
});
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
let input = null;
let output = null;
let answer = "";
rl.on("line", line => {
input = +line;
output = Array(input)
.fill()
.map((v, i) => i + 1)
.reverse();
rl.close();
}).on("close", () => {
output.forEach(v => (answer += `${v}\n`));
console.log(answer);
process.exit();
});
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
let input = [];
let output = null;
let answer = "";
let limit = 999;
rl.on("line", line => {
input.push(line);
limit = +input[0];
// 최초 입력한 값만큼만 입력받기
if (limit === input.length - 1) rl.close();
}).on("close", () => {
input = input.filter((v, i) => i !== 0);
input.forEach((v, i) => {
output = v.split(" ");
answer += `Case #${i + 1}: ${+output[0] + +output[1]}\n`;
});
console.log(answer);
process.exit();
});
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
let input = [];
let output = null;
let answer = "";
let limit = 999;
rl.on("line", line => {
input.push(line);
limit = +input[0];
// 최초 입력한 값만큼만 입력받기
if (limit === input.length - 1) rl.close();
}).on("close", () => {
input = input.filter((v, i) => i !== 0);
input.forEach((v, i) => {
output = v.split(" ");
answer += `Case #${i + 1}: ${output[0]} + ${output[1]} = ${+output[0] + +output[1]}\n`;
});
console.log(answer);
process.exit();
});
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
let input = [];
let answer = "";
rl.on("line", line => {
input = +line;
rl.close();
}).on("close", () => {
for (let i = 0; i < input; i++) {
for (let j = 0; j <= i; j++) {
answer += `*`;
}
answer += `\n`;
}
console.log(answer);
process.exit();
});
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
let input = [];
let answer = "";
rl.on("line", line => {
input = +line;
rl.close();
}).on("close", () => {
for (let i = 0; i < input; i++) {
for (let j = input; j > i + 1; j--) {
answer += ` `;
}
for (let k = 0; k <= i; k++) {
answer += `*`;
}
answer += `\n`;
}
console.log(answer);
process.exit();
});
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
let input = [];
let answer = "";
let limit = 999;
rl.on("line", line => {
input.push(line.split(" "));
limit = +input[0][0];
// 최초 입력한 값만큼만 입력받기
if (input.length > 1 && limit === input[1].length) rl.close();
}).on("close", () => {
const number = +input[0][1];
input[1].filter(v => +v < number).forEach(v => (answer += `${v} `));
console.log(answer);
process.exit();
});