import java.util.Scanner; public class Main { public static void main(String[] args) { //接受一個只包含小寫字母的字符串,然后輸出該字符串反轉后的字符串。(字符串長度不超過1000 Scanner scanner = new Scanner(System.in); String num01 = scanner.nextLine(); if(num01.length()>1000) { System.out.println("輸入長度超標"); }else { StringBuffer sb = new StringBuffer(num01); System.out.println(sb.reverse().toString()); } } }