/* * determine whether expressed as a character array of strings for palindrome (left and right sides is symmetrical, such as level, deed, etc.) */
Public class Test02 {
Public static void main (String [] args) {
Scanner sc=new Scanner(System.in); System. The out. Print (" please input a string: ");
The String key=sc. NextLine ();
System. The out. Print (" please lose the length of the string: ");
Int N=sc. NextInt ();
Int m=0;
String [] s=new String [N].
for(int i=0; i
M=1;
break;
}
}
If (m==1) {
System. The out. Println (" the string not palindrome ");
}
The else {
System. The out. Println (" this string palindrome ");
}}}
The inside of the for loop to judge conditions how to modify?
CodePudding user response:
String. ToCharArray, do you want to make a String into a character array, or String. The charAt