# include <stdio.h>
int isPalindrome(char s[]){
int wordNum = 0;
char p[100];
while(s[wordNum]!='\0')
{
wordNum++;
}
for(int i = 0; i < wordNum; i++)
{
p[i] = s[wordNum - i - 1];
}
p[wordNum] ='\0';
//printf("%s, %s\n", s, p);
for(int n = 0; s[n] == p[n]; n++)
{
if(s[n] == '\0')
return 1;
}
return 0;
}
//メイン関数は書き換えなくてよいです
int main(){
char s[100];
printf("%s -> %d\n",s
,isPalindrome
(s
)); return 0;
}
IyBpbmNsdWRlIDxzdGRpby5oPgoKaW50IGlzUGFsaW5kcm9tZShjaGFyIHNbXSl7CgppbnQgd29yZE51bSA9IDA7CmNoYXIgcFsxMDBdOwoKd2hpbGUoc1t3b3JkTnVtXSE9J1wwJykKewoJd29yZE51bSsrOwp9Cgpmb3IoaW50IGkgPSAwOyBpIDwgd29yZE51bTsgaSsrKQp7CglwW2ldID0gc1t3b3JkTnVtIC0gaSAtIDFdOwp9CnBbd29yZE51bV0gPSdcMCc7Ci8vcHJpbnRmKCIlcywgJXNcbiIsIHMsIHApOwoKZm9yKGludCBuID0gMDsgc1tuXSA9PSBwW25dOyBuKyspCnsKCWlmKHNbbl0gPT0gJ1wwJykKCXJldHVybiAxOwp9CnJldHVybiAwOwoKfQoKLy/jg6HjgqTjg7PplqLmlbDjga/mm7jjgY3mj5vjgYjjgarjgY/jgabjgojjgYTjgafjgZkKaW50IG1haW4oKXsKICAgIGNoYXIgc1sxMDBdOwogICAgc2NhbmYoIiVzIixzKTsKICAgIHByaW50ZigiJXMgLT4gJWRcbiIscyxpc1BhbGluZHJvbWUocykpOwogICAgcmV0dXJuIDA7Cn0K