# include <stdio.h>
int isPalindrome(char s[]){
int t[100];
int count=0;
for(int i=0;s[i]!='\0';i++){
count++;
}
for(int j=0;j<count;j++){
t[j]=s[count-j-1];
printf("t[%d] %c s[%d] %c\n",j
,t
[j
],count
-j
-1,s
[count
-j
-1]); }
for(int k=0;s[k]==t[k];k++){
printf("s[%d] %c t[%d] %c\n", k
, s
[k
], k
, t
[k
]); if(s[k]=='\0'){
return 1;
}
}
return 0;
}
int main(){
char s[100];
printf("%s -> %d\n",s
,isPalindrome
(s
)); return 0;
}
IyBpbmNsdWRlIDxzdGRpby5oPgoKaW50IGlzUGFsaW5kcm9tZShjaGFyIHNbXSl7CglpbnQgdFsxMDBdOwoJaW50IGNvdW50PTA7CgkKCWZvcihpbnQgaT0wO3NbaV0hPSdcMCc7aSsrKXsKCQljb3VudCsrOwoJfQoJCglwcmludGYoImNvdW50PSVkXG4iLGNvdW50KTsKCQoJcHJpbnRmKCLphY3liJd0IOOBq+S7o+WFpVxuIik7Cglmb3IoaW50IGo9MDtqPGNvdW50O2orKyl7CgkJdFtqXT1zW2NvdW50LWotMV07CgkJcHJpbnRmKCJ0WyVkXSAlYyBzWyVkXSAlY1xuIixqLHRbal0sY291bnQtai0xLHNbY291bnQtai0xXSk7Cgl9CgkKCXByaW50Zigi5q+U6LyDXG4iKTsKCWZvcihpbnQgaz0wO3Nba109PXRba107aysrKXsKCQlwcmludGYoInNbJWRdICVjIHRbJWRdICVjXG4iLCBrLCBzW2tdLCBrLCB0W2tdKTsKCQlpZihzW2tdPT0nXDAnKXsKCQkJcmV0dXJuIDE7CgkJfSAKCX0KCXJldHVybiAwOwoKfQoKaW50IG1haW4oKXsKICAgIGNoYXIgc1sxMDBdOwogICAgc2NhbmYoIiVzIixzKTsKICAgIHByaW50ZigiJXMgLT4gJWRcbiIscyxpc1BhbGluZHJvbWUocykpOwogICAgcmV0dXJuIDA7Cn0=