[ 다먹살 ]/- Coding

[백준] 2743 단어 길이 재기

엉망으로살기 2022. 4. 24. 21:22
반응형

https://www.acmicpc.net/problem/2743

 

2743번: 단어 길이 재기

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

www.acmicpc.net

입력을 받아서 문자열의 개수를 구하면 되는 매우 간단한 문제였다.


문제 및 입출력


코드

import java.util.Scanner;

public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        String input = sc.nextLine();
        
        System.out.println(input.length());
        sc.close();
    }
}

 

반응형