实现代码
java
public static void solution(){
String s ="woh era uoy? I ma enif.";
String [] arr = s.split(" ");
String ans = null;
for (String s1 : arr) {
int len = s1.length();
String temp ="";
String d = null;
for (int i=len-1;i>=0;i--){
if (Character.isLetter(s1.charAt(i))){
temp+=s1.charAt(i);
}else {
d=s1.charAt(i)+"";
}
}
if (null != d){
temp+=d;
}
if (null==ans){
ans=temp;
}else {
ans=ans+" "+temp;
}
}
System.out.println(ans);
}