import java.util.*;
public class Test10 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("请输入你需要翻转的字符串");
String str = in.next();
StringBuffer strr = new StringBuffer(str);
str = strr.reverse().toString();
System.out.println("翻转后的字符串为:"+str);
}
}
字符串翻转
最新推荐文章于 2024-02-02 07:53:35 发布