题解 | #HJ013 句子逆序#
句子逆序
http://www.nowcoder.com/practice/48b3cb4e3c694d9da5526e6255bb73c3
import java.util.Scanner;
/**
* HJ13 句子逆序
*/
public class HJ013 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String line = sc.nextLine();
String[] array = line.split(" ");
for (int i = array.length - 1; i >= 0; i--) {
System.out.print(array[i] + " ");
}
sc.close();
}
}