fork(1) download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main(void)
  5. {
  6. char word[100],tmp;
  7. int p,k;
  8.  
  9. printf("Give a line: ");
  10. scanf("%[^\n]99s%*c",word);
  11. for(p=0,k=strlen(word);p<--k;++p)
  12. {
  13. tmp=word[p];
  14. word[p]=word[k];
  15. word[k]=tmp;
  16. }
  17. printf("From the back it is: \"%s\"\n",word);
  18. // getchar(); // Jeżeli tego potrzebujesz to zmień IDE na jakieś z tego tysiąclecia
  19. return 0;
  20. }
Success #stdin #stdout 0s 2252KB
stdin
Ala ma kota
stdout
Give a line: From the back it is: "atok am alA"