import org.junit.Test;
public class solution {
@Test
public void testFunc(){
String string = "i am a studeng.";
String res = reverseWord(string);
System.out.println("res: "+res);
}
// 翻转单词顺序
public String reverseWord(String str){
String[] strArr = str.split(" ");
String res="";
for(int i=strArr.length-1;i>0;i--){
res=res+strArr[i]+" ";
}
res=res+strArr[0];
return res;
}
}