#include <stdio.h>
#include <ctype.h>
#include <string.h>
#define MAX_LEN 1000
// 回文判定関数
int is_palindrome(char str[]) {
int left = 0;
while (left < right) {
// 左側の文字がアルファベットまたは数字でない場合は次へ
if (!isalnum((unsigned char)str
[left
])) { left++;
continue;
}
// 右側の文字がアルファベットまたは数字でない場合は次へ
if (!isalnum((unsigned char)str
[right
])) { right--;
continue;
}
// 小文字に変換して比較
if (tolower((unsigned char)str
[left
]) != tolower((unsigned char)str
[right
])) { return 0; // 回文ではない
}
left++;
right--;
}
return 1; // 回文
}
int main() {
char sentence[MAX_LEN];
fgets(sentence
, sizeof(sentence
), stdin
);
// fgetsで入力すると改行が含まれるので取り除く
sentence
[strcspn(sentence
, "\n")] = '\0';
if (is_palindrome(sentence)) {
} else {
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxjdHlwZS5oPgojaW5jbHVkZSA8c3RyaW5nLmg+CgojZGVmaW5lIE1BWF9MRU4gMTAwMAoKLy8g5Zue5paH5Yik5a6a6Zai5pWwCmludCBpc19wYWxpbmRyb21lKGNoYXIgc3RyW10pIHsKICAgIGludCBsZWZ0ID0gMDsKICAgIGludCByaWdodCA9IHN0cmxlbihzdHIpIC0gMTsKCiAgICB3aGlsZSAobGVmdCA8IHJpZ2h0KSB7CiAgICAgICAgLy8g5bem5YG044Gu5paH5a2X44GM44Ki44Or44OV44Kh44OZ44OD44OI44G+44Gf44Gv5pWw5a2X44Gn44Gq44GE5aC05ZCI44Gv5qyh44G4CiAgICAgICAgaWYgKCFpc2FsbnVtKCh1bnNpZ25lZCBjaGFyKXN0cltsZWZ0XSkpIHsKICAgICAgICAgICAgbGVmdCsrOwogICAgICAgICAgICBjb250aW51ZTsKICAgICAgICB9CiAgICAgICAgLy8g5Y+z5YG044Gu5paH5a2X44GM44Ki44Or44OV44Kh44OZ44OD44OI44G+44Gf44Gv5pWw5a2X44Gn44Gq44GE5aC05ZCI44Gv5qyh44G4CiAgICAgICAgaWYgKCFpc2FsbnVtKCh1bnNpZ25lZCBjaGFyKXN0cltyaWdodF0pKSB7CiAgICAgICAgICAgIHJpZ2h0LS07CiAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgIH0KICAgICAgICAvLyDlsI/mloflrZfjgavlpInmj5vjgZfjgabmr5TovIMKICAgICAgICBpZiAodG9sb3dlcigodW5zaWduZWQgY2hhcilzdHJbbGVmdF0pICE9IHRvbG93ZXIoKHVuc2lnbmVkIGNoYXIpc3RyW3JpZ2h0XSkpIHsKICAgICAgICAgICAgcmV0dXJuIDA7IC8vIOWbnuaWh+OBp+OBr+OBquOBhAogICAgICAgIH0KICAgICAgICBsZWZ0Kys7CiAgICAgICAgcmlnaHQtLTsKICAgIH0KICAgIHJldHVybiAxOyAvLyDlm57mlocKfQoKaW50IG1haW4oKSB7CiAgICBjaGFyIHNlbnRlbmNlW01BWF9MRU5dOwoKICAgIHByaW50Zigi5paH5a2X5YiX44KS5YWl5Yqb44GX44Gm44GP44Gg44GV44GEOiAiKTsKICAgIGZnZXRzKHNlbnRlbmNlLCBzaXplb2Yoc2VudGVuY2UpLCBzdGRpbik7CiAgICAKICAgIC8vIGZnZXRz44Gn5YWl5Yqb44GZ44KL44Go5pS56KGM44GM5ZCr44G+44KM44KL44Gu44Gn5Y+W44KK6Zmk44GPCiAgICBzZW50ZW5jZVtzdHJjc3BuKHNlbnRlbmNlLCAiXG4iKV0gPSAnXDAnOwoKICAgIGlmIChpc19wYWxpbmRyb21lKHNlbnRlbmNlKSkgewogICAgICAgIHByaW50Zigi44GT44Gu5paH44Gv5Zue5paH44Gn44GZ44CCXG4iKTsKICAgIH0gZWxzZSB7CiAgICAgICAgcHJpbnRmKCLjgZPjga7mlofjga/lm57mlofjgafjga/jgYLjgorjgb7jgZvjgpPjgIJcbiIpOwogICAgfQoKICAgIHJldHVybiAwOwp9Cg==