题解 | #单词倒排#
单词倒排
http://www.nowcoder.com/practice/81544a4989df4109b33c2d65037c5836
正则表达式几行搞定
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
String[] split = str.split("[^a-zA-Z]+");
for (int i = split.length-1; i >= 0; i--) {
System.out.print(split[i]+" ");
}
}
}