#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;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgaXNQYWxpbmRyb21lKGNoYXIgc1tdKSB7CiAgICBpbnQgbGVmdCA9IDA7CiAgICBpbnQgcmlnaHQgPSAwOwoKICAgIHdoaWxlIChzW3JpZ2h0XSAhPSAnXDAnKSB7CiAgICAgICAgcmlnaHQrKzsKICAgIH0KICAgIHJpZ2h0LS07IAogICAgCiAgICB3aGlsZSAobGVmdCA8IHJpZ2h0KSB7CiAgICAgICAgaWYgKHNbbGVmdF0gIT0gc1tyaWdodF0pIHsKICAgICAgICAgICAgcmV0dXJuIDA7IAogICAgICAgIH0KICAgICAgICBsZWZ0Kys7CiAgICAgICAgcmlnaHQtLTsKICAgIH0KCiAgICByZXR1cm4gMTsgCn0KCmludCBtYWluKCkgewogICAgY2hhciBzWzEwMF07CiAgICBzY2FuZigiJXMiLCBzKTsKICAgIHByaW50ZigiJXMgLT4gJWRcbiIsIHMsIGlzUGFsaW5kcm9tZShzKSk7CiAgICByZXR1cm4gMDsKfQoK