Text string (hangdian 2029)

Source: Internet
Author: User

/* Palindromes _ easy version
Problem description
A "text return string" is a string with the same reading and deserialization. For example, "level" or "Noon" is a text return string. Write a program to check whether the read string is a "reply ".
 

Input
The input contains multiple test instances. The first line of input data is a positive integer N, indicating the number of test instances, followed by N strings.

 

Output
If a string is a return string, "yes" is output; otherwise, "no" is output ".

 

Sample Input
4
Level
ABCDE
Noon
Haha
 

Sample output
Yes
No
Yes
No


*/

# Include <stdio. h>
# Include <string. h>
Int main ()
{
Char STR [100010];
Int test, Len, I, J;
While (~ Scanf ("% d", & Test ))
{
Getchar (); // note the location of getchar.
While (test --)
{
Gets (STR );
Len = strlen (STR );
For (I = 0, j = len-1; I <j; I ++, j --) // compare the first character in the string with the most character
If (STR [I]! = STR [J])
{
Printf ("NO \ n ");
Break;
}
If (I> = J)
Printf ("Yes \ n ");
}
}
Return 0;
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.