题解 | #字符串反转#
字符串反转
http://www.nowcoder.com/practice/e45e078701ab4e4cb49393ae30f1bb04
跟上一道数组的是一样的,会用reverse就行
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
while(scan.hasNext()){
String str = scan.nextLine();
StringBuilder strb = new StringBuilder();
strb.append(str);
strb.reverse();
System.out.println(strb.toString());
}
}
}