#include <stdio.h>
int isPalindrome(char s[]) {
int start = 0;
int end = 0;
// 文字列の長さを計算
while (s[end] != '\0') {
end++;
}
end--; // 最後の文字のインデックスに合わせる
// 回文チェック
while (start < end) {
if (s[start] != s[end]) {
return 0; // 回文ではない
}
start++;
end--;
}
return 1; // 回文である
}
int main() {
char s[100];
printf("%s -> %d\n", s
, isPalindrome
(s
)); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgaXNQYWxpbmRyb21lKGNoYXIgc1tdKSB7CiAgICBpbnQgc3RhcnQgPSAwOwogICAgaW50IGVuZCA9IDA7CgogICAgLy8g5paH5a2X5YiX44Gu6ZW344GV44KS6KiI566XCiAgICB3aGlsZSAoc1tlbmRdICE9ICdcMCcpIHsKICAgICAgICBlbmQrKzsKICAgIH0KICAgIGVuZC0tOyAvLyDmnIDlvozjga7mloflrZfjga7jgqTjg7Pjg4fjg4Pjgq/jgrnjgavlkIjjgo/jgZvjgosKCiAgICAvLyDlm57mlofjg4Hjgqfjg4Pjgq8KICAgIHdoaWxlIChzdGFydCA8IGVuZCkgewogICAgICAgIGlmIChzW3N0YXJ0XSAhPSBzW2VuZF0pIHsKICAgICAgICAgICAgcmV0dXJuIDA7IC8vIOWbnuaWh+OBp+OBr+OBquOBhAogICAgICAgIH0KICAgICAgICBzdGFydCsrOwogICAgICAgIGVuZC0tOwogICAgfQoKICAgIHJldHVybiAxOyAvLyDlm57mlofjgafjgYLjgosKfQoKaW50IG1haW4oKSB7CiAgICBjaGFyIHNbMTAwXTsKICAgIHNjYW5mKCIlcyIsIHMpOwogICAgcHJpbnRmKCIlcyAtPiAlZFxuIiwgcywgaXNQYWxpbmRyb21lKHMpKTsKICAgIHJldHVybiAwOwp9Cg==