回文数

#include<stdio.h>
#include<string.h>
int main( )
{
 int N,len;
 scanf("%d",&N);
 while(N--)
 {
  int flag=0;
  char ch[100],*p,*q;
  scanf("%s",ch);
  len=strlen(ch);
  for(p=ch,q=ch+len-1;p<=q;p++,q--)
  if(*p!=*q)
  {puts("no");flag=1;break;}
  if(!flag)
  puts("yes");
}
return 0;
}
  
 

posted on 2011-04-29 13:55  more think, more gains  阅读(161)  评论(0编辑  收藏  举报

导航