#include <stdio.h>
#include <string.h>
int main(void)
{
char s[80], ch, *p, *q;
int i, j, n;
gets(s);
p =s;
while ( *p == ' ')
p++;
n = strlen(s);
q = s+n-1;
while ( *q == ' ')
q--;
while ( p<=q && *p ==*q)
{
p++;
q--;
}
if ( p<q )
printf("NO\n");
else
printf("YES\n");
return 0;
}
先消除输入字符串的前后空格,再判断是否是“回文”
猜你喜欢
转载自blog.csdn.net/KEVINzzh/article/details/103794831
今日推荐
周排行