[恢]hdu 2029

2011-12-14 03:51:49

地址:http://acm.hdu.edu.cn/showproblem.php?pid=2029

题意:中文题。

代码:

# include <stdio.h>
# include <string.h>


int IsPalindromes(char str[])
{
int i, len = strlen (str) ;
for (i = 0 ; i < len/2 ; i++)
if (str[i] != str[len-i-1]) return 0 ;
return 1 ;
}


int main ()
{
int n ;
char str[1010] ;
while (~scanf ("%d", &n))
{
getchar () ;
while (n--)
{
gets (str) ;
puts (IsPalindromes(str) ? "yes" : "no") ;
}
}
return 0 ;
}



posted @ 2012-01-06 14:27  Seraph2012  阅读(145)  评论(0编辑  收藏  举报