Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. #include<stdlib.h>
  4.  
  5. char obrat(char ret[],int a)
  6. {
  7. int i,j=0;
  8. char *ret1;
  9. ret1=(char*)malloc(a+1);
  10.  
  11. for (i=a;i>=0;i--)
  12. {
  13. ret1[j++]=ret[i];
  14. }
  15. return ret1;
  16. }
  17.  
  18.  
  19.  
  20.  
  21. int main()
  22. {
  23. int a;
  24. char ret[256];
  25.  
  26. printf("prvy\n");
  27. fgets(ret,256,stdin);
  28. a=(strlen(ret));
  29. printf("%d\n",a);
  30.  
  31. printf("%s",obrat(ret,a));
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement