fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. int main()
  6. {
  7. char buffer[200];
  8. printf("Podaj zdanie: ");
  9. scanf("%[^\n]",buffer); // bez s
  10. int size=strlen(buffer);
  11. char *text=(char*)malloc(size+1); // sizeof(char) zawsze 1, nie ma co dzielić na 2 wierszy
  12. strcpy(text,buffer);
  13. printf("%s\n",text); // nie ma co robić tego w 2 wiersze
  14. for(int i=0;i<size;++i) text[i]=((unsigned)(unsigned char)~text[i])>>1;
  15. printf("%s\n",text);
  16. free(text); // przydzieliłeś nie zapomnij zwolnić
  17. return 0;
  18. }
  19.  
  20.  
Success #stdin #stdout 0s 5260KB
stdin
Ala ma kota.
stdout
Podaj zdanie: Ala ma kota.
_IOoIOoJHEOh