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

๐Ÿ“ ์•Œ๊ณ ๋ฆฌ์ฆ˜/Softeer

[Javascript(NodeJS)/Softeer] Lv1. A+B

728x90

 

https://softeer.ai/practice/6295

 

Softeer - ํ˜„๋Œ€์ž๋™์ฐจ๊ทธ๋ฃน SW์ธ์žฌํ™•๋ณดํ”Œ๋žซํผ

 

softeer.ai

 

ํ˜„๋Œ€ ์†Œํ”„ํ‹ฐ์–ด Lv1. A+B js ํ’€์ด

 

์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ์ฝ”ํ…Œ ์‰ฝ์ง€์•Š๋‹ค

๊ทธ๋ž˜๋„ ๊ฐœ๋ฐœ ์งฌ๋ฐ”๋กœ ์–ด์ฐŒ์–ด์ฐŒ ๊ทน๋ณตํ•˜๋Š”์ค‘..^-^


const readline = require('readline');

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

let sum = 0;
let result = [];

rl.on('line', input =>{
    arr = input.split(' ').map(el=>parseInt(el));
    if(arr.length >1) {
        sum = arr[0] + arr[1];
        result.push(sum);
    }
})

rl.on('close', ()=>{
    for(let i=0; i<result.length; ++i){
        console.log("Case #"+(i+1)+":", result[i]);
    }
})

728x90