목록ALGORITHM/BOJ (20)
오늘도 코딩하나
#10807 (개수 세기)solution1_for.const fs = require('fs');const file = process.platform === 'linux' ? '/dev/stdin' : __dirname+'/input.txt';const input = fs.readFileSync(file).toString().trim().split('\n');let num = parseInt(input[0]);let numbers = input[1].trim().split(' ').map(Number);let findNum = parseInt(input[2]);let arr = [];for(let i=0; i e === findNum).length;console.log(result); solution2_f..
#2438 (별 찍기 - 1)const fs = require('fs');const file = process.platform === 'linux' ? '/dev/stdin' : __dirname+'/input.txt';const input = fs.readFileSync(file).toString().trim();let num = parseInt(input);let star = "";for(let i=0; i #2439 (별 찍기 - 2)solution1_for문 2개.const fs = require('fs');const file = process.platform === 'linux' ? '/dev/stdin' : __dirname+'/input.txt';const input = fs.readFile..
#25314 (코딩은 체육과목 입니다)solution1.const fs = require("fs");const file = process.platform === "linux" ? "/dev/stdin" : __dirname + "/input.txt";const input = fs.readFileSync(file).toString().trim();let num = parseInt(input) / 4;let result = "";for (let i = 0; i solution2_repeat함수 활용.const fs = require("fs");const file = process.platform === "linux" ? "/dev/stdin" : __dirname + "/input.txt";const in..
#2739 (구구단)const fs = require('fs');const file = process.platform === 'linux' ? '/dev/stdin' : __dirname+'/input.txt';const input = fs.readFileSync(file).toString().trim();for(let i=1; i #10950 (A+B - 3)const fs = require('fs');const file = process.platform === 'linux' ? '/dev/stdin' : __dirname+'/input.txt';const input = fs.readFileSync(file).toString().trim().split('\n');let cnt = parseInt(inp..
#2884 (알람시계)const fs = require('fs');const file = process.platform === 'linux' ? '/dev/stdin' : __dirname+'/input.txt';const input = fs.readFileSync(file).toString().trim().split(' ');let h = Number(input[0]);let m = Number(input[1]);let alarm = '';if(m #2525 (오븐 시계)const fs = require('fs');const file = process.platform === 'linux' ? '/dev/stdin' : __dirname+'/input.txt';const input = fs.readFi..
#14681 (사분면 고르기)const fs = require('fs');const [a,b] = fs.readFileSync(file).trim().split("\n").map(Number);if(a>0 && b>0) { console.log(1);} else if(a0) { console.log(2);} else if(a ▶ 제출 결과 : 런타임 에러ㅠ solution1_fs.const fs = require('fs');const [a,b] = fs.readFileSync(0).toString().trim().split("\n").map(Number);if(a>0 && b>0) { console.log(1);} else if(a0) { console.log(2);} else i..
#1330 (두 수 비교하기)const fs = require('fs');const file = process.platform === 'linux' ? '/dev/stdin' : __dirname+'/input.txt';const [a,b] = fs.readFileSync(file).toString().split(' ').map(Number);if(a > b) { console.log(">")} else if(a #9498 (시험 성적)const fs = require('fs');const file = process.platform === 'linux' ? '/dev/stdin' : __dirname+'/input.txt';const input = fs.readFileSync(file).toStr..