fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3. #define BUFF_SIZE 80
  4.  
  5. void hanten(char *s);
  6.  
  7. int main(void) {
  8. char s[BUFF_SIZE];
  9. fgets(s, BUFF_SIZE, stdin);
  10. hanten(s);
  11. return 0;
  12. }
  13. void hanten(char *s) {
  14. int i, k;
  15.  
  16. k = strlen(s);
  17.  
  18. for (i = (k >= 4 ? 3 : k - 1); i >= 0; i--) {
  19. printf("%c", s[i]);
  20. }
  21. }
  22.  
Success #stdin #stdout 0s 2116KB
stdin
abcdef
stdout
dcba