개요[ | ]
- HR자바 Java String Tokens
Java
Copy
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String s = scan.nextLine();
scan.close();
s = s.trim();
if( s.length() == 0 ) {
System.out.println(0);
return;
}
String[] words = s.split("[^a-zA-Z]+");
System.out.println(words.length);
for(String word: words) {
System.out.println(word);
}
}
}
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.