목록ALGORITHM/BOJ (20)
오늘도 코딩하나
#11382 (꼬마 정민)const fs = require('fs');const file = process.platform === 'linux' ? '/dev/stdin' : __dirname+'/input.txt';const [a,b,c] = fs.readFileSync(file).toString().split(' ').map(Number);console.log(a+b+c); ** reduce함수 활용const fs = require('fs');const file = process.platform === 'linux' ? '/dev/stdin' : __dirname+'/input.txt';const input = fs.readFileSync(file).toString().trim().split(' '..
#2588 (곱셈)solution1.const fs = require('fs');const file = process.platform === 'linux' ? '/dev/stdin' : __dirname+'/input.txt';const input = fs.readFileSync(file).toString().split('\n');const a = input[0].split('').map(Number);const b = input[1].split('').map(Number);const calc1 = Number(input[0]) * b[2];const calc2 = Number(input[0]) * b[1];const calc3 = Number(input[0]) * b[0];console.log(calc..
#10926 (??!)const fs = require('fs');const file = process.platform === 'linux' ? '/dev/stdin' : __dirname+'/input.txt';const input = fs.readFileSync(file).toString().trim();console.log(`${input}??!`); #18108 (1998년생인 내가 태국에서는 2541년생?!)const fs = require('fs');const file = process.platform === 'linux' ? '/dev/stdin' : __dirname+'/input.txt';const input = fs.readFileSync(file).toString();console.l..
** 개발환경 : WindowMac, Linux는 유닉스 기반이라 /dev/stdin을 읽어주면 Terminal 상에서 입력할 수 있다.Window에서는 불가능하기 때문에 로컬에 있는 파일을 읽어와서 입력을 테스트해야한다.(Mac : "/dev/stdin" ------ Window : __dirname+"/input.txt") #1000 (+)const fs = require('fs');const input1 = fs.readFileSync(__dirname+'/input.txt').toString().split(' ')console.log(Number(input[0]) + Number(input[1])); const fs = require('fs');const input = fs.readFileSync..