#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char* setPalindrome(const char*s) {
char* palindrome
=(char*)malloc((2*len
+1)*sizeof(char)); if(palindrome==NULL) {
return NULL;
}
for(int i=0;i<len;i++) {
palindrome[len+i]=s[len-1-i];
}
palindrome[2*len]='\0';
return palindrome;
}
int main() {
char str[100];
char*palindrome=setPalindrome(str);
if(palindrome!=NULL) {
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHN0cmluZy5oPgoKY2hhciogc2V0UGFsaW5kcm9tZShjb25zdCBjaGFyKnMpIHsKICAgIGludCBsZW49c3RybGVuKHMpOwogICAgY2hhciogcGFsaW5kcm9tZT0oY2hhciopbWFsbG9jKCgyKmxlbisxKSpzaXplb2YoY2hhcikpOwogICAgaWYocGFsaW5kcm9tZT09TlVMTCkgewogICAgICAgIHByaW50Zigi44Oh44Oi44Oq44Gu56K65L+d44Gr5aSx5pWX44GX44G+44GX44Gf44CCXG4iKTsKICAgICAgICByZXR1cm4gTlVMTDsKICAgIH0KCiAgICBzdHJjcHkocGFsaW5kcm9tZSwgcyk7CgogICAgZm9yKGludCBpPTA7aTxsZW47aSsrKSB7CiAgICAgICAgcGFsaW5kcm9tZVtsZW4raV09c1tsZW4tMS1pXTsKICAgIH0KCiAgICBwYWxpbmRyb21lWzIqbGVuXT0nXDAnOwoKICAgIHJldHVybiBwYWxpbmRyb21lOwp9CgppbnQgbWFpbigpIHsKICAgIGNoYXIgc3RyWzEwMF07CiAgICBzY2FuZigiJTk5cyIsc3RyKTsKCiAgICBjaGFyKnBhbGluZHJvbWU9c2V0UGFsaW5kcm9tZShzdHIpOwogICAgaWYocGFsaW5kcm9tZSE9TlVMTCkgewogICAgICAgIHByaW50Zigi5Zue5paHOiVzXG4iLHBhbGluZHJvbWUpOwogICAgICAgIGZyZWUocGFsaW5kcm9tZSk7CiAgICB9CgogICAgcmV0dXJuIDA7Cn0K