回文字符串 题解:C
#include <stdio.h>
#include <string.h>
int main()
{
char s[1000];
while(gets(s) != NULL)
{
char *p,*q;
p = s;
q = s;
while(*q != '\0')
q++;
q--;
while(p < q && *p == *q) p++,q--;
if(p >= q) printf("Yes!\n");
else printf("No!\n");
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发