fork(1) download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. void reverse(char string[], char out[]) {
  5.  
  6.  
  7. int i = 0;
  8. int j = strlen(string);
  9.  
  10. out[strlen(string)] = '\0';
  11.  
  12. while(j != 0)
  13. {
  14. if (string[j-1]>96 && string[j-1] < 123)
  15. {
  16.  
  17. string[j-1] = string[j-1]-32;
  18. out[i] = string[j-1];
  19. }
  20. else
  21. {
  22. out[i] = string[j-1];
  23. }
  24. i++;
  25. j--;
  26.  
  27. // memcpy(out, string, strlen(string)+1); // Wywalic to
  28. }
  29. }
  30. int main(void) {
  31.  
  32. char out[1024],string[1024];
  33. printf("Podaj zdanie, ktore chcesz odwrocic\n");
  34. fgets(string,1024,stdin);
  35. reverse(string, out);
  36. puts(out);
  37. return 0;
  38. }
Success #stdin #stdout 0s 2296KB
stdin
Standard input is empty
stdout
Podaj zdanie, ktore chcesz odwrocic
�