Java 代码
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner cin = new Scanner(System.in);
String s = cin.nextLine();
String[] w = s.split(" ");
for (int i = w.length - 1; i >= 0; i --)
System.out.print(w[i] + " ");
}
}