[백준] 2743. 단어 길이 재기

c.Hano·2025년 4월 24일

백준

목록 보기
6/8


참고

String값을 입력 받을 경우 : .nextLine();
String의 문자열의 길이를 재는 명령어 : .length();

정답

import java.util.* ;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        
        System.out.println(s.length());
    }
}
profile
꼬질이

0개의 댓글