BOJ | #1000 "A+B"

블로그 이사 완료·2022년 9월 18일
0
post-thumbnail

문제


Code

const fs = require("fs");
const filePath = process.platform === 'linux' ? '/dev/stdin' : '.input.txt';
let input = fs.readFileSync(filePath).toString().split("\n");

input = input[0];
input = input.split(" ").map((item) => +item);

console.log(input[0]+input[1]);

Review

입력 값을 받아 배열형태로 변경하고 map메소드를 통해 String을 Number로 변환해서 연산해서 해결했다.


참고 : map() - MDN Web Docs

profile
https://kyledev.tistory.com/

0개의 댓글