- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSolution.java
More file actions
Latest commit
19 lines (15 loc) · 512 Bytes
/
Copy pathSolution.java
File metadata and controls
19 lines (15 loc) · 512 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
importjava.util.Scanner;
publicclassSolution {
publicstaticvoidmain(String[] args) {
Scannerscan = newScanner(System.in);
Strings = scan.nextLine().trim();
if (s.length() > 0 && s.length() < 400000) {
String[] tokens = s.split("[ @_'.,?!]+");
System.out.println(tokens.length);
for (Stringstring : tokens) {
System.out.println(string);
}
} elseSystem.out.println(0);
scan.close();
}
}