node.js
-
문제 이름 : 문자열 압축 function solution(s) { let answer = [s.length]; let half = Math.floor(s.length/2); let sl = s.length; for(let i=1;i
[Programmers] 문자열 압축 문제 - (javascript)문제 이름 : 문자열 압축 function solution(s) { let answer = [s.length]; let half = Math.floor(s.length/2); let sl = s.length; for(let i=1;i
2021.12.31 -
문제 번호 : 2739번 문제 바로가기 ☞ https://www.acmicpc.net/problem/2739 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString(); // 입력 값이 하나일 땐 split을 사용하지 말 것 solution(Number(input)); function solution(A){ let a = A; for(let i=1;i
[BaekJoon] 2739 번 구구단 문제 - (nodejs)문제 번호 : 2739번 문제 바로가기 ☞ https://www.acmicpc.net/problem/2739 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString(); // 입력 값이 하나일 땐 split을 사용하지 말 것 solution(Number(input)); function solution(A){ let a = A; for(let i=1;i
2021.12.28 -
문제 번호 : 1330번 문제 바로가기 ☞ https://www.acmicpc.net/problem/1330 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().split('\n'); input = input[0].split(' '); solution(input[0], input[1]); function solution(A, B){ let a = Number(A); let b = Number(B); if (a>b) console.log('>') else if (a
[BaekJoon] 1330 번 두 수 비교하기 문제 - (nods.js)문제 번호 : 1330번 문제 바로가기 ☞ https://www.acmicpc.net/problem/1330 const fs = require('fs'); const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(filePath).toString().split('\n'); input = input[0].split(' '); solution(input[0], input[1]); function solution(A, B){ let a = Number(A); let b = Number(B); if (a>b) console.log('>') else if (a
2021.12.28