전체 글87 [백준] 10871 Node.js const fs = require('fs'); const input = fs.readFileSync('/dev/stdin').toString().split('\n'); const info = input[0].split(' '); const numbers = input[1].split(' '); let result = ''; for(let i = 0; i < Number(info[0]); i++) { if(Number(numbers[i]) < Number(info[1])) { result += numbers[i]+ ' '; } } console.log(result) 2022. 9. 2. [백준] 10950 Node.js const fs = require('fs'); const input = fs.readFileSync("/dev/stdin").toString().trim().split("\n"); for (let i = 1; i 2022. 9. 1. [백준] 10872 Node.js 팩토리얼 const fs = require('fs'); const input = parseInt(fs.readFileSync('/dev/stdin').toString().trim()); const factorial = (n) => { if(n === 1 || n === 0) { return 1; } return n * factorial(n-1) } console.log(factorial(input)) 2022. 8. 31. [백준] 2420 사파리월드 Node.js const fs = require('fs'); const input = fs.readFileSync("/dev/stdin").toString().trim().split(" "); console.log(Math.abs(input[0] - input[1])) 2022. 8. 30. 이전 1 ··· 8 9 10 11 12 13 14 ··· 22 다음