# 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]); }
t[count]='\0';
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+WFpVxuIik7Cglmb3IoaW50IGo9MDtqPGNvdW50O2orKyl7CgkJdFtqXT1zW2NvdW50LWotMV07CgkJcHJpbnRmKCJ0WyVkXSAlYyBzWyVkXSAlY1xuIixqLHRbal0sY291bnQtai0xLHNbY291bnQtai0xXSk7Cgl9Cgl0W2NvdW50XT0nXDAnOwoJCglwcmludGYoIuavlOi8g1xuIik7Cglmb3IoaW50IGs9MDtzW2tdPT10W2tdO2srKyl7CgkJcHJpbnRmKCJzWyVkXSAlYyB0WyVkXSAlY1xuIiwgaywgc1trXSwgaywgdFtrXSk7CgkJaWYoc1trXT09J1wwJyl7CgkJCXJldHVybiAxOwoJCX0gCgl9CglyZXR1cm4gMDsKCn0KCmludCBtYWluKCl7CiAgICBjaGFyIHNbMTAwXTsKICAgIHNjYW5mKCIlcyIscyk7CiAgICBwcmludGYoIiVzIC0+ICVkXG4iLHMsaXNQYWxpbmRyb21lKHMpKTsKICAgIHJldHVybiAwOwp9