import java.util.Scanner;
public class SplitWords {
public static void main(String[] args) {
System.out.println(Please input some english words,separate with ',' or SPACE );
Scanner scanner = new Scanner(System.in);
String input = scanner.nextLine();
String[] words = input.replace(',',' ').replace('.',' ').split(\\s+);
System.out.println(Total + words.length + separate word in + input);
System.out.println(Words with 4 characters are as follows:);
int count = 0;
for(String str:words){
if(count == 5){
System.out.println();
count = 0;
}
if(str.length() == 4){
System.out.print(str + \t);
count++;
}
}
}
}
------------------
Please input some english words,separate with ',' or SPACE
Today is Christmas Day,we people in china don't celebrate it.I like china very much.
Total 16 separate word in Today is Christmas Day,we people in china don't celebrate it.I like china very much.
Words with 4 characters are as follows:
like very much