题解 | #句子逆序#
句子逆序
http://www.nowcoder.com/practice/48b3cb4e3c694d9da5526e6255bb73c3
换成数组直接逆序输出就行
import java.util.*;
public class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
String[] str = sc.nextLine().split(" ");
for (int i = str.length - 1;i >= 0 ; i--) {
System.out.print(str[i] + " ");
}
}
}