#include "stdio.h"
int main(int argv,char *argc[]){
char s[100],i,k;
printf("Input string, Ctrl+Z end...\n");
while(gets(s)){
for(k=0;s[k];k++);
for(k--,i=0;iif(s[i]-s[k])
break;
if(i>=k)
printf("\n'%s' is a palindrome string\n\n",s);
else
printf("\n'%s' is not a palindrome string\n\n",s);
}
return 0;
}
运行样例: