목록코딩기초트레이닝 (5)
COCO World
🐳 문제 설명 두 정수 a, b가 주어질 때 다음과 같은 형태의 계산식을 출력하는 코드를 작성해 보세요. a + b = c 🐳 제한 조건 1 ≤ a, b ≤ 100 🐳 입출력 예 입력 #1 4 5 출력 #2 4 + 5 = 9 🐳 작성 솔루션 const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); let input = []; rl.on('line', function (line) { input = line.split(' '); }).on('close', function () { //console.log(Number(input[0]) + Num..
🐳 문제 설명 다음과 같이 출력하도록 코드를 작성해 주세요. 🐳 제한 조건 - 🐳 입출력 예 !@#$%^&*(\'"?:; 🐳 작성 솔루션 const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); rl.on('close', function () { //console.log('!@#$%^&*(\\\'"?:;') console.log('!@#$%^&*(\\\'"?:;') }); 🐳 끄적끄적 특수문자 출력 방법 코드 표시(출력) \' 작은 따옴표 \" 큰 따옴표 \\ 백슬래시 \n 줄 바꿈 \r 캐리지 리턴(CR) \t 탭(TAB) \b 백스페이스..
🐳 문제 설명 영어 알파벳으로 이루어진 문자열 str이 주어집니다. 각 알파벳을 대문자는 소문자로 소문자는 대문자로 변환해서 출력하는 코드를 작성해 보세요. 🐳 제한 조건 1 ≤ str의 길이 ≤ 20 🐳 입출력 예 입력 #1 aBcDeFg 출력 #1 AbCdEfG 🐳 작성 솔루션 const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); let input = []; rl.on('line', function (line) { input = [line]; }).on('close',function(){ str = input[0]; result = ..
const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); let input = []; rl.on('line', function (line) { input = line.split(' '); }).on('close', function () { str = input[0]; n = Number(input[1]); console.log(str.repeat(n)); }); 🐳 문제 설명 문자열 str과 정수 n이 주어집니다. str이 n번 반복된 문자열을 만들어 출력하는 코드를 작성해 보세요. 🐳 제한 조건 1 ≤ str의 길이 ≤ 10 1 ≤ n ≤..
🐳 문제 설명 정수 a와 b가 주어집니다. 각 수를 입력받아 입출력 예와 같은 형식으로 출력하는 코드를 작성해 보세요. 🐳 제한 조건 -100,000 ≤ a, b ≤ 100,000 🐳 입출력 예 입력 #1 4 5 입력 #2 a = 4 b = 5 🐳 작성 솔루션 const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); let input = []; rl.on('line', function (line) { input = line.split(' '); }).on('close', function () { console.log(`a = ${Number..