4 level abcde noon haha
yes no yes no
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); scanner.nextLine(); while (n-- != 0) { String str = scanner.nextLine(); int len = str.length(); boolean flag = true; for (int i = 0; i < len / 2; i++) { if (!(str.charAt(i) == str.charAt(len - i - 1))) { flag = false; break; } } System.out.println(flag ? "yes" : "no"); } } }