[BJ / 2743] 단어 길이 재기

Lainlnya·2023년 3월 31일
0

BaekJoon

목록 보기
20/37

문제

알파벳으로만 이루어진 단어를 입력받아, 그 길이를 출력하는 프로그램을 작성하시오.

입력

첫째 줄에 영어 소문자와 대문자로만 이루어진 단어가 주어진다. 단어의 길이는 최대 100이다.

출력

첫째 줄에 입력으로 주어진 단어의 길이를 출력한다.

예시

풀이

이걸 못하는건 안될 것 같은 문제(?)

const readline = require('readline');

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
});

let input = '';
rl.on('line', (line) => {
  input = line;
});

rl.on('close', () => {
  console.log(solution(input));
});

function solution(word) {
  return word.length;
}
profile
Growing up

0개의 댓글