题解 | #倒置字符串#
倒置字符串
http://www.nowcoder.com/questionTerminal/8869d99cf1264e60a6d9eff4295e5bab
字符串大类的题目还是使用java语言非常方便
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s1 = sc.nextLine();
String [] str = s1.split(" ");
StringBuffer stringBuffer = new StringBuffer();
for (int i = str.length-1; i >= 0 ; i--) {
stringBuffer.append(str[i]+" ");
}
stringBuffer.deleteCharAt(stringBuffer.length()-1);
System.out.println(stringBuffer.toString());
}
}