题目2答案
public class StrPalindromic {
public static void main(String[] args) {
String str = "able was i ere i saw elba@";
isReturn(str);
}
public static void isReturn(String str)
{
str=str.substring(0, str.indexOf('@'));
for(int i=0;i
if(str.charAt(i)!=str.charAt(str.length()-1-i))
{
System.out.println(str+" "+ "不是回文");
return;
}
}
System.out.println(str+" "+"是回文");
}
}
专门做java作业 see my name .find me