int func(char *s)
{
char *p = s;
while(*p)p++;
p--;
while(*p == *s && p>s) p--,s++;
return p<=s;
}
追问完整的怎么编
追答int func(char *s)
{
char *p = s;
while(*p)p++;
p--;
while(*p == *s && p>s) p--,s++;
return p<=s;
}
int main()
{
char s[100];
scanf("%s",s);
if(func(s)) printf("%s是回文\n",s);
else printf("%s不是回文\n",s);
}
追问谢谢哦
为什么结果是反的呢