Created
March 26, 2020 18:50
-
-
Save goyuninfo/3afec965ea1d9d4dc3cd48d8248d9a5b to your computer and use it in GitHub Desktop.
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.io.*; | |
import java.util.*; | |
public class Solution { | |
public static void main(final String[] args) { | |
final Scanner scan = new Scanner(System.in); | |
if (!scan.hasNext()) { | |
System.out.print("0"); | |
return; | |
} | |
final String s = scan.nextLine(); | |
final String[] items = s.trim().split("[ !,?.\\_'@]+"); | |
if (s == "") { | |
System.out.println("0"); | |
} else if (s.length() > 400000) { | |
return; | |
} else { | |
System.out.println(items.length); | |
} | |
for (final String item : items) { | |
System.out.println(item); | |
} | |
scan.close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment