#include <stdio.h>
#include <string.h>
int isPalindrome(const char* str) {
int left = 0;
while (left < right) {
if (str[left] != str[right]) {
return 0; // 回文ではない場合は0を返す
}
left++;
right--;
}
return 1; // 回文の場合は1を返す
}
int main() {
char str[100];
if (isPalindrome(str)) {
} else {
printf("%s は回文ではありません\n", str
); }
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdHJpbmcuaD4KCmludCBpc1BhbGluZHJvbWUoY29uc3QgY2hhciogc3RyKSB7CiAgICBpbnQgbGVmdCA9IDA7CiAgICBpbnQgcmlnaHQgPSBzdHJsZW4oc3RyKSAtIDE7CgogICAgd2hpbGUgKGxlZnQgPCByaWdodCkgewogICAgICAgIGlmIChzdHJbbGVmdF0gIT0gc3RyW3JpZ2h0XSkgewogICAgICAgICAgICByZXR1cm4gMDsgIC8vIOWbnuaWh+OBp+OBr+OBquOBhOWgtOWQiOOBrzDjgpLov5TjgZkKICAgICAgICB9CiAgICAgICAgbGVmdCsrOwogICAgICAgIHJpZ2h0LS07CiAgICB9CgogICAgcmV0dXJuIDE7ICAvLyDlm57mlofjga7loLTlkIjjga8x44KS6L+U44GZCn0KCmludCBtYWluKCkgewogICAgY2hhciBzdHJbMTAwXTsKICAgIHNjYW5mKCIlcyIsIHN0cik7CgogICAgaWYgKGlzUGFsaW5kcm9tZShzdHIpKSB7CiAgICAgICAgcHJpbnRmKCIlcyDjga/lm57mlofjgafjgZlcbiIsIHN0cik7CiAgICB9IGVsc2UgewogICAgICAgIHByaW50ZigiJXMg44Gv5Zue5paH44Gn44Gv44GC44KK44G+44Gb44KTXG4iLCBzdHIpOwogICAgfQoKICAgIHJldHVybiAwOwp9Cg==