본문 바로가기
  • search_ _ _ _
  • search_ _ _ _
  • search_ _ _ _
스터디/goormLevel_문제풀기

[난이도 1] 정수의 길이

by 오늘의갈비찜 2024. 7. 2.
728x90

 

 

 

 

// Run by Node.js
const readline = require('readline');

(async () => {
	let rl = readline.createInterface({ input: process.stdin });
	
	for await (const line of rl) {
		console.log('Hello Goorm! Your input is', line);
		rl.close();
	}
	
	process.exit();
})();

 

처음 초기 모습이다.

 

정수의 길이를 찾는 문제이므로

 

 

 

정답

console.log(line.length);  // String.length 문자열의 길이를 구할 수 있다.

728x90