본문 바로가기
반응형
[백준] 단계별로 풀어보기 4단계 | Node.js 백준 알고리즘 4단계 while문 https://www.acmicpc.net/step/2 while문 단계 입력이 끝날 때까지 A+B를 출력하는 문제. EOF에 대해 알아 보세요. www.acmicpc.net 01. A + B - 5 | 10952번 const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); let answer = ''; let i = 0; const arr = []; rl.on('line', (num) => { const input = num.split(' '); arr.push(input); while (i < arr.l.. 2021. 7. 9.
[백준] 단계별로 풀어보기 3단계 | Node.js 백준 알고리즘 3단계 for문 01. 구구단 const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, }); rl.on('line', (num) => { for (let i = 1; i { process.exit(); }); 02. A+B - 3 const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, }); const input = []; rl.on('line', (num) => { input.push(num); if (input.length === Number(inpu.. 2021. 6. 26.
[백준] 단계별로 풀어보기 2단계 | Node.js 백준 알고리즘 2단계 if문 01. 두 수 비교하기 const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, }); rl.on('line', (line) => { const input = line.split(' '); const a = Number(input[0]); const b = Number(input[1]); if (a > b) console.log('>'); if (a < b) console.log(' 2021. 6. 26.
[백준] 단계별로 풀어보기 1단계 | Node.js 백준 알고리즘 1단계 입출력과 사칙연산 01. We love kriii console.log('강한친구 대한육군'); console.log('강한친구 대한육군'); 02. 고양이 console.log(`\\ /\\`); console.log(` ) ( ')`); console.log(`( / )`); console.log(` \\(__)|`); 03. 개 console.log(`|\\_/|`); console.log(`|q p| /}`); console.log(`( 0 )"""\\`); console.log('|"^"` |'); console.log(`||\_/=\\\\\_\_|`); 04. 사칙연산 const readline = require('readline'); const rl = readline... 2021. 6. 24.
반응형