Post

[BOJ 2743] 단어 길이 재기

Baekjoon Online Judge 2743(Java 11)
[단어 길이 재기] 문제 풀이

[BOJ 2743] 단어 길이 재기

-> 문제 바로가기



시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초128 MB115432910808129679.823%

문제


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


입력


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


출력


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


예제


1
2
// 입력
pulljima
1
2
// 출력
8


출처


  • 데이터를 추가한 사람: 79brue
  • 문제를 만든 사람: baekjoon


알고리즘 분류








제출



내 제출


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import java.io.*;

public class Main {
    public static void solution() throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));

        String askii = br.readLine();

        bw.write(String.valueOf(askii.length()));

        bw.flush();
        bw.close();
        br.close();
    }

    public static void main(String[] args) throws IOException {
        solution();
    }
}


런타임메모리
112 ms14236 KB


Reference


This post is licensed under CC BY 4.0 by the author.