
#include <stdio.h> #include <string.h> int ispal(char* p,char* q) { return p>=q || *p==*q && ispal(p+1,q-1); } int palindrome(char *s) { return ispal(s,s+strlen(s)-1); } int main() { static char buf[1000]; while(scanf("%s",buf)==1){ printf("%d\n",palindrome(buf)); } }