fork(1) download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. void reverse(char *s)
  5. {
  6. char *t=s;
  7. while(*t)
  8. t++;
  9. t--;
  10. while(s < t)
  11. {
  12. char temp=*s;
  13. *s++=*t;
  14. *t--=temp;
  15. }
  16. }
  17.  
  18. int main()
  19. {
  20. char s[100];
  21. gets(s);
  22. reverse(s);
  23. puts(s);
  24. return 0;
  25. }
Success #stdin #stdout 0s 2164KB
stdin
alphabetical
stdout
lacitebahpla