일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- 쉬운 문제
- Node.js
- HTTP
- Crawling
- 그래프
- 문자열
- 프로그래머스
- 프로그래머스 레벨 2
- 자바스크립트
- 크롤링
- Algorithm
- javascript
- 소켓
- 알고리즘
- HTTP 완벽 가이드
- typescript
- socket
- dp
- ip
- 수학
- Nestjs
- 타입스크립트
- TCP
- 타입 챌린지
- type challenge
- 백준
- 가천대
- 레벨 1
- dfs
- BFS
- Today
- Total
목록숫자 (2)
kakasoo

const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); rl.on("line", (line) => { main(line); process.exit(); }); /** * * @param {string} line */ const main = (line) => { let [A, B] = line.split(" ").map(BigInt); if (A > B) { let temp = A; A = B; B = temp; } if (A === B || A + BigInt(1) === B) { console.log(0); return; } let a..

형변환 JavaScript에서는 명시적인 형변환, 묵시적인 형변환이 있다. 엄밀히 말해, 묵시적인 형변환은 Wrapper 함수로 인한 형변환이라고 할 수 있겠다. 여기서는 둘의 구분 없이, 자주 보게되는 형태의 형변환들을 짚고 넘어가고자 한다. String String(1) === '1'; // true 1 + "" = '1' // true String으로 감싸서 문자열로 변경할 수도 있으며, 숫자에 문자열을 더해 변경할 수도 있다. Number Number('1') === 1 // true '1' - 0 === 1 // true +'1' === 1 // true '1' / 1 === 1 // true String과 마찬가지로 Number로 감싸서 숫자로 변경하는 것이 가능하고, 뺄셈이나 나눗셈으로도 가..