public class Solution {
public static void main(String[] args) {
String word = "Ротор";
String answer = isPalindrome(word) ? "Да" : "Нет";
System.out.println("Слово \"" + word + "\" палиндром? " + answer);
}
public static boolean isPalindrome(String word) {
return (word.equalsIgnoreCase(new StringBuilder(word).reverse().toString()) ? true : false);
}
}
public static void main(String[] args) {
String word = "Ротор";
String answer = isPalindrome(word) ? "Да" : "Нет";
System.out.println("Слово \"" + word + "\" палиндром? " + answer);
}
public static boolean isPalindrome(String word) {
return (word.equalsIgnoreCase(new StringBuilder(word).reverse().toString()) ? true : false);
}
}