Preparing NOJ
Write a program that determines if each input string is a palindrome. A palindrome is a
string that reads exactly the same in both forward and reverse directions. For something
to be considered a palindrome, it must be at least 1 character long. For the purposes of
your program, ignore any characters that are not letters, as well as spaces when
determining if a string is a palindrome.
The first line of input contains an integer N that indicates the number of test strings to
follow. On each subsequent line there will be a single test string. Here is a sample:
For each test string, output "yes" if the string was a palindrome, and "no" if it was not a
palindrome. Remember: Ignore any characters that are not letters, as well as spaces.
5
able ##was I, e****re I s.aw $Elba
this is not a palindrome
A man, a plan, a canal, Panama
another random string
Sator Arepo Tenet Opera Rotas
yes
no
yes
no
yes
undefined
本题由旧版NOJ导入,来源:Internet