#C1055. Taco Palindrome Checker
Taco Palindrome Checker
Taco Palindrome Checker
You are given a list of words. For each word, determine whether it is a palindrome. A word is a palindrome if it reads the same forwards and backwards. For a word s of length \( n \), it is a palindrome if \( s[i] = s[n-i-1] \) for all \( 0 \leq i < n \).
Your task is to write a program that reads an integer T
denoting the number of test cases, followed by T
words. For each word, output "YES" if it is a palindrome and "NO" otherwise.
Note: The input is given via standard input (stdin) and the output should be printed to standard output (stdout).
inputFormat
The first line contains an integer T
representing the number of test cases. The next T
lines each contain a single word.
Constraints:
- Each word consists of only lowercase and/or uppercase English letters.
- The length of each word is at least 1.
outputFormat
For each test case, output a single line containing "YES" if the word is a palindrome, and "NO" otherwise.
## sample3
racecar
hello
madam
YES
NO
YES
</p>