public static void main(String[] args) {

Scanner scan =new Scanner(System.in);

String s=scan.nextLine();

int length = s.length();

char[] ch = s.toCharArray();

for (int i=0;i

if (ch[i] == ch[length-i-1]){

System.out.println("您输入的字符串是回文!");

}

}

}
Last modification:May 5th, 2020 at 06:22 pm
如果觉得我的文章对你有用,请随意赞赏