Matt Gerrans
Posts: 1153
Nickname: matt
Registered: Feb, 2002
|
|
Re: Help me!!!!
|
Posted: Oct 4, 2003 5:51 PM
|
|
Sheesh, I think this homework assignment has been rehashed a thousand times here, but just in case you are too lazy to search the forum (which is apparently the case), here is the solution (it compiles fine and you can turn it in as-is):
public class P{public static boolean _(String __){for(int ___=0;___<__
.length()/2;___++)if(__.charAt(___)!=__.charAt(__.length()-___-1))
return false;return true;}public static void main(String[] __){for(int
___=0;___< __.length;___++)System.out.println("\""+__[___]+"\" is "+
(_(__[___])?"":"not ")+"a palindrome.");}}
|
|