-
<백준(node.js)> 10757번: 큰 수 A+B유물/└ 백준 2022. 2. 21. 17:27728x90
🤖
문제
https://www.acmicpc.net/problem/10757
풀이
const filePath = process.platform === "linux" ? "/dev/stdin" : "../input.txt"; const INPUT_ARR = require("fs").readFileSync(filePath).toString().trim().split(" "); console.log( INPUT_ARR.reduce((pre, cur) => BigInt(pre) + BigInt(cur)).toString() );
1. (line 5) 주어진 숫자 2개를 BigInt형으로 만들고 더합니다. BigInt형이라 숫자 마지막에 n이 붙으므로 문자열로 변환하여 n을 제거합니다.
📌
https://nyang-in.tistory.com/176
728x90'유물 > └ 백준' 카테고리의 다른 글
<백준(파이썬)> 1068번: 트리 (0) 2022.03.23 <백준(node.js)> 1978번: 소수 찾기 (0) 2022.02.22 <백준(node.js)> 2839번: 설탕 배달 (0) 2022.02.20 <백준(node.js)> 2775번: 부녀회장이 될테야 (0) 2022.02.19 <백준(node.js)> 10250번: ACM 호텔 (0) 2022.02.17