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