import java.util.*; public class PalindromeV1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("输入一个字符串: "); String word = sc.next(); int i = word.length(); int j = 0; while (j <= (i / 2) -1 && word.charAt(j) == word.charAt(i - j - 1)) j++; if (j == i / 2) System.out.println("输入字符串是回文."); else System.out.println("输入字符串不是回文."); } } //java/7225