public static void main(String[] args) throws Exception {
String ss = "aghdtdhga";
char[] cc = ss.trim().toCharArray();
int first = 0;
int last = cc.length - 1;
while (first < last) {
if (cc[first++] != cc[last--]) {
System.out.println("false");
}
}
System.out.println("true");
}
网友评论