题解 | #提取不重复的整数#
句子逆序
http://www.nowcoder.com/practice/48b3cb4e3c694d9da5526e6255bb73c3
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s= sc.nextLine();
StringBuilder sb = new StringBuilder();
for (int i = s.length()-1; i >=0; i--) {
if(s.charAt(i)== ' '){
sb.append(s,i+1,s.length());
sb.append(' ');
s = s.substring(0,i);
}
}
sb.append(s);
System.out.println(sb.toString());
}
}