Preparing NOJ

Palindromes

1000ms 81920K

Description:

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.


Input:

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:


Output:

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.


Sample Input:

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

Sample Output:

yes
no
yes
no
yes

Note:

undefined

本题由旧版NOJ导入,来源:Internet

Info

NOJ

Provider NOJ

Code NOJ1384

Tags

Submitted 2

Passed 1

AC Rate 50%

Date 04/20/2019 10:03:10

Related

Nothing Yet