๐ŸŒˆ ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค

[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค:Javascript] a์™€ b ์ถœ๋ ฅํ•˜๊ธฐ

Eun_zii 2024. 4. 11. 16:19

ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค Lv.0

- a์™€ b ์ถœ๋ ฅํ•˜๊ธฐ

 

๐Ÿ’š ๋ฌธ์ œ์„ค๋ช…

 

๐Ÿ’š ์ œํ•œ์กฐ๊ฑด

  • -100,000 ≤ a, b ≤ 100,000

๐Ÿ’š ํ’€์ด

const readline = require('readline');
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let input = [];

rl.on('line', function (line) {
    input = line.split(' ');
}).on('close', function () {
    const a = Number(input[0]);
    const b = Number(input[1]);

    console.log(`a = ${a}`);
    console.log(`b = ${b}`);
});

 

โœ… 

๋ฐฐ์—ด์˜ ์ฒซ ๋ฒˆ์งธ์™€ ๋‘ ๋ฒˆ์งธ ์š”์†Œ๋ฅผ ์ •์ˆ˜๋กœ ๋ณ€ํ™˜ํ•˜์—ฌ a์™€ b ๋ณ€์ˆ˜์— ํ• ๋‹นํ•ด์ค€ํ›„, ์ž…์ถœ๋ ฅ์˜ˆ ์— ๋งž๊ฒŒ ์ถœ๋ ฅํ•ด์ค€๋‹ค.

 

console.log('a = ' + Number(input[0]));
console.log('b = ' + Number(input[1]));

 

๋ณ€์ˆ˜์— ํ• ๋‹นํ•˜์ง€ ์•Š๊ณ  ๋ฐ”๋กœ ์ถœ๋ ฅํ• ์ˆ˜๋„ ์žˆ๋‹ค.

728x90