Written by
java-style
on
on
[백준] 1152 단어의 개수 - 자바, StringTokenizer
[백준] 1152 단어의 개수 - 자바, StringTokenizer
문제
https://www.acmicpc.net/problem/1152
풀이 코드
StringTokenizer의 countTokens() 메서드를 사용하여 단어의 개수 계산
public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); System.out.println(st.countTokens()); } }
728x90
from http://developer-hm.tistory.com/141 by ccl(A) rewrite - 2021-09-17 15:27:45