문제 설명
1. 단어를 입력받아 길이 출력
풀이
1. String.length()
코드
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import java.io.*; | |
/** | |
* https://www.acmicpc.net/problem/2743 | |
* BOJ 백준온라인져지 2743 단어 길이 재기 풀이 | |
*/ | |
public class Main { | |
private static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); | |
public static void main(String args[]) throws IOException { | |
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | |
bw.write(String.valueOf(br.readLine().length())); | |
bw.flush(); | |
} | |
} |
문제
알파벳으로만 이루어진 단어를 입력받아, 그 길이를 출력하는 프로그램을 작성하시오.
입력
첫째 줄에 영어 소문자와 대문자로만 이루어진 단어가 주어진다. 단어의 길이는 최대 100이다.
출력
첫째 줄에 입력으로 주어진 단어의 길이를 출력한다.
예제 입력 1
pulljima
예제 출력 1
8
'IT > 알고리즘' 카테고리의 다른 글
BOJ 백준온라인져지 9465 스티커 풀이 (0) | 2018.06.07 |
---|---|
BOJ 백준온라인져지 1012 유기농 배추 풀이 (0) | 2018.06.07 |
BOJ 백준온라인져지 2443 별찍기 - 6 풀이 (0) | 2018.06.05 |
BOJ 백준온라인져지 2444 별찍기 - 7 풀이 (0) | 2018.06.05 |
BOJ 백준온라인져지 1010 다리 놓기 풀이 (0) | 2018.06.04 |