asdasfafsf   2년 전

fs로통째로 입력받으면 오류날 수 있음.

LF뒤에 무언가 쓰레기 값이 더 붙어오는듯? 


올바른 예

const input = require('fs') .readFileSync(process.platform === 'linux' ? '/dev/stdin' : './input.txt', 'utf-8') .toString() .trim() .split('\n')[0];



틀린 예

const input = require('fs') .readFileSync(process.platform === 'linux' ? '/dev/stdin' : './input.txt', 'utf-8') .toString() .trim() 

댓글을 작성하려면 로그인해야 합니다.