언젠가는 펼쳐 볼 아카이브
[BOJ] 11005번 - 진법 변환2 본문
사용언어 : javascript - node.js
#제출코드
const fs = require('fs');
const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt';
const [num, radix] = fs.readFileSync(filePath).toString().trim().split(' ');
solution(+num, +radix);
function solution(num, radix) {
console.log(num.toString(radix).toUpperCase());
}
>> 진법 변환 1 문제와 동일하게 풀음.
참고 : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString
'IT > Baekjoon Oline Judge' 카테고리의 다른 글
[BOJ] 2903번 - 중앙 이동 알고리즘 (0) | 2023.08.28 |
---|---|
[BOJ] 2720번 - 세탁소 사장 동혁 (0) | 2023.08.28 |
[BOJ] 2745번 - 진법 변환 (0) | 2023.08.25 |
[BOJ] 2563번 - 색종이 (0) | 2023.08.23 |
[BOJ] 10798번 - 세로읽기 (0) | 2023.08.23 |