#K34912. Palindrome Checker
Palindrome Checker
Palindrome Checker
Given a number of test cases T and T strings, your task is to determine for each string whether it is a palindrome.
A string is a palindrome if it reads the same forward and backward. Note that the check is case-sensitive and spaces or special characters are treated as regular characters.
Example:
Input: 3 racecar hello madam</p>Output: YES NO YES
Your program should read input from standard input and print the result to standard output.
inputFormat
The input begins with an integer T
on the first line, representing the number of test cases. Each of the following T
lines contains a single string to be checked.
For example:
3 racecar hello madam
outputFormat
For each test case, output a single line containing YES
if the associated string is a palindrome, or NO
otherwise.
For the above example, the output should be:
YES NO YES## sample
3
racecar
hello
madam
YES
NO
YES
</p>