#include<stdio.h>
#include<stdlib.h>
int myStrlen(char s[]){
int i;
for(i=0;s[i]!='\0';i++);
return i;
}
char *setPalindrome(char s[]){
char *tmp;
int i,j;
j=myStrlen(s);
tmp
=(char *)malloc((2*j
)*sizeof(char)); for(i=0;i<j;i++){
tmp[i]=s[i];
}
for(i=0;i<j;i++){
tmp[j+i]=s[j-i-1];
}
tmp[2*j]='\0';
return tmp;
}
int main(){
int i;
char nyuryoku[1024];
char *kaibun;
kaibun=setPalindrome(nyuryoku);
printf("%s-> %s\n",nyuryoku
,kaibun
); return 0;
}
I2luY2x1ZGU8c3RkaW8uaD4KI2luY2x1ZGU8c3RkbGliLmg+CmludCBteVN0cmxlbihjaGFyIHNbXSl7CglpbnQgaTsKCWZvcihpPTA7c1tpXSE9J1wwJztpKyspOwoJcmV0dXJuIGk7Cn0KCmNoYXIgKnNldFBhbGluZHJvbWUoY2hhciBzW10pewoJY2hhciAqdG1wOwoJaW50IGksajsKCWo9bXlTdHJsZW4ocyk7Cgl0bXA9KGNoYXIgKiltYWxsb2MoKDIqaikqc2l6ZW9mKGNoYXIpKTsKCWZvcihpPTA7aTxqO2krKyl7CgkJdG1wW2ldPXNbaV07Cgl9Cglmb3IoaT0wO2k8ajtpKyspewoJCXRtcFtqK2ldPXNbai1pLTFdOwoJfQoJdG1wWzIqal09J1wwJzsKCXJldHVybiB0bXA7Cn0KCmludCBtYWluKCl7CglpbnQgaTsKCWNoYXIgbnl1cnlva3VbMTAyNF07CgljaGFyICprYWlidW47CglzY2FuZigiJXMiLG55dXJ5b2t1KTsKCWthaWJ1bj1zZXRQYWxpbmRyb21lKG55dXJ5b2t1KTsKCXByaW50ZigiJXMtPiAlc1xuIixueXVyeW9rdSxrYWlidW4pOwoJZnJlZShrYWlidW4pOwoJcmV0dXJuIDA7Cn0=