# include <stdio.h>
int isPalindrome(char s[]){
// 関数の中だけを書き換えてください
// 回文になっているとき1を返す
// 回文になっていないとき0を返す
int len = 0;
while (s[len] != '\0') {
len++;
}
int left = 0;
int right = len - 1;
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;
}
IyBpbmNsdWRlIDxzdGRpby5oPgoKaW50IGlzUGFsaW5kcm9tZShjaGFyIHNbXSl7CiAgICAvLyDplqLmlbDjga7kuK3jgaDjgZHjgpLmm7jjgY3mj5vjgYjjgabjgY/jgaDjgZXjgYQKICAgIC8vIOWbnuaWh+OBq+OBquOBo+OBpuOBhOOCi+OBqOOBje+8keOCkui/lOOBmQogICAgLy8g5Zue5paH44Gr44Gq44Gj44Gm44GE44Gq44GE44Go44GN77yQ44KS6L+U44GZCgogICAgaW50IGxlbiA9IDA7CiAgICB3aGlsZSAoc1tsZW5dICE9ICdcMCcpIHsKICAgICAgICBsZW4rKzsKICAgIH0KICAgIGludCBsZWZ0ID0gMDsgICAgICAgICAgCiAgICBpbnQgcmlnaHQgPSBsZW4gLSAxOyAgIAoKICAgIHdoaWxlIChsZWZ0IDwgcmlnaHQpIHsKICAgICAgICBpZiAoc1tsZWZ0XSAhPSBzW3JpZ2h0XSkgewogICAgICAgICAgICByZXR1cm4gMDsgCiAgICAgICAgfQogICAgICAgIGxlZnQrKzsKICAgICAgICByaWdodC0tOwogICAgfQoKICAgIC8vIOODq+ODvOODl+OBjOWujOS6huOBl+OBn+WgtOWQiOOAgeWFqOOBpuOBruWvvuW/nOOBmeOCi+aWh+Wtl+OBjOS4gOiHtOOBl+OBn+OBn+OCgeWbnuaWh+OBp+OBguOCiwogICAgcmV0dXJuIDE7Cn0KCi8v44Oh44Kk44Oz6Zai5pWw44Gv5pu444GN5o+b44GI44Gq44GP44Gm44KI44GE44Gn44GZCmludCBtYWluKCl7CiAgICBjaGFyIHNbMTAwXTsKICAgIHNjYW5mKCIlcyIscyk7CiAgICBwcmludGYoIiVzIC0+ICVkXG4iLHMsaXNQYWxpbmRyb21lKHMpKTsKICAgIHJldHVybiAwOwp9Cg==