import java.util.Scanner;
public class Test {
public static void main(String[] args) { System.out.println("请输入字符串:"); Scanner sc = new Scanner(System.in);
String str= sc.next(); boolean flag= isHuiWen(str); System.out.println(flag); }
public static boolean isHuiWen(String str) { char[] ch = str.toCharArray(); boolean flag=true; for (int i = 0,j=ch.length-1; i < ch.length/2; i++,j--) { if(ch[i]!=ch[j]) { flag=false; } } return flag; }
}