题解 | #句子逆序#
句子逆序
http://www.nowcoder.com/practice/48b3cb4e3c694d9da5526e6255bb73c3
傻瓜题
import java.util.Scanner; public class HJ13 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner in=new Scanner(System.in); String str=in.nextLine(); String s[]=str.split(" "); for(int i=s.length-1;i>=0;i--) if(i!=0) System.out.print(s[i]+" "); else System.out.print(s[i]); } }