package com.patience.interview.huawei;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.regex.Pattern;
public class PatternHandleString {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
Pattern ex = Pattern.compile("[a-zA-Z\\s']+");
boolean f = ex.matcher(str).matches();
if(f){
String [] s = str.split("\\s");
for (int i = s.length - 1;i >= 0; i--){
System.out.print(s[i]+" ");
}
}
}
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28