//課題3
# include <stdio.h>
int isPalindrome(char s[]){
int i,h_counts,counts;
for(i=0;s[i]!='\0';i++){
;
}
counts=i;
h_counts=i-1;
if(counts%2==0){
for(i=0;s[i]==s[h_counts-i];i++){
if(i==h_counts/2)return 1;
}
}else if(counts%2==1){
for(i=0;s[i]==s[h_counts-i];i++){
if(i==counts/2)return 1;
}
}
return 0;
}
//メイン関数は書き換えなくてよいです
int main(){
char s[100];
printf("%s -> %d\n",s
,isPalindrome
(s
)); return 0;
}
Ly/oqrLpoYzvvJMKIyBpbmNsdWRlIDxzdGRpby5oPgoKaW50IGlzUGFsaW5kcm9tZShjaGFyIHNbXSl7CmludCBpLGhfY291bnRzLGNvdW50czsKZm9yKGk9MDtzW2ldIT0nXDAnO2krKyl7Cgk7Cn0KY291bnRzPWk7CmhfY291bnRzPWktMTsKaWYoY291bnRzJTI9PTApewoJZm9yKGk9MDtzW2ldPT1zW2hfY291bnRzLWldO2krKyl7CgkJaWYoaT09aF9jb3VudHMvMilyZXR1cm4gMTsKCX0KfWVsc2UgaWYoY291bnRzJTI9PTEpewoJCWZvcihpPTA7c1tpXT09c1toX2NvdW50cy1pXTtpKyspewoJCWlmKGk9PWNvdW50cy8yKXJldHVybiAxOwp9Cn0KcmV0dXJuIDA7Cgp9CgovL+ODoeOCpOODs+mWouaVsOOBr+abuOOBjeaPm+OBiOOBquOBj+OBpuOCiOOBhOOBp+OBmQppbnQgbWFpbigpewogICAgY2hhciBzWzEwMF07CiAgICBzY2FuZigiJXMiLHMpOwogICAgcHJpbnRmKCIlcyAtPiAlZFxuIixzLGlzUGFsaW5kcm9tZShzKSk7CiAgICByZXR1cm4gMDsKfQo=