fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4.  
  5. int main(void){
  6. FILE *in;
  7. FILE *out;
  8. unsigned int BLOCK_SIZE = 3;
  9. char block[BLOCK_SIZE];
  10.  
  11. in = fopen("input.txt", "rt");
  12. if(in == NULL){ fputs("File error", stderr); return 1; }
  13.  
  14. out = fopen("output.txt", "wt");
  15. if(out == NULL){ fputs("File error", stderr); return 1; }
  16.  
  17. while(!feof(in)){
  18. memset(block, 0, sizeof(block)); //Îáíóëÿåì áëîê
  19. fread(block, sizeof(block), BLOCK_SIZE, in);
  20. fwrite(block, sizeof(block), BLOCK_SIZE, out);
  21.  
  22. //!!!!!!!!
  23. for(int i = 0; i < BLOCK_SIZE; i++){
  24. printf("%c", block[i]);
  25. printf(" ");
  26. }
  27. printf("\n");
  28.  
  29. }
  30.  
  31. fclose(in);
  32. fclose(out);
  33.  
  34. int p;
  35. scanf("%d", p);
  36. }
Runtime error #stdin #stdout #stderr 0s 3224KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
File error