fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int mystrlen(char s[]){
  5. int i;
  6. for(i=0;s[i]!='\0';i++){
  7. ;
  8. }
  9. return i;
  10. }
  11.  
  12. int main(void){
  13. int size,i,j;
  14. char s[1024];
  15. char *a;
  16. scanf("%s",s);
  17. size=mystrlen(s);
  18. a=(char *)malloc(sizeof(char)*(2*size+1));
  19. if(a==NULL){
  20. printf("ERROR\n");
  21. return 0;
  22. }
  23. for(i=0;i<size;i++){
  24. a[i]=s[i];
  25. }
  26. for(j=0;j<size;j++){
  27. a[size+j]=s[size-j-1];
  28. }
  29. printf("%s",a);
  30. free(a);
  31. return 0;
  32. }
Success #stdin #stdout 0s 5316KB
stdin
aee
stdout
aeeeea