fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include "alphabet.h"
  4.  
  5.  
  6. int main(void){
  7. FILE *in;
  8. FILE *out;
  9. const unsigned int BLOCK_SIZE = 3;
  10. char block[BLOCK_SIZE];
  11.  
  12. in = fopen("input.txt", "rt");
  13. if(in == NULL){ fputs("File error", stderr); return 1; }
  14.  
  15. out = fopen("output.txt", "wt");
  16. if(out == NULL){ fputs("File error", stderr); return 1; }
  17.  
  18. while(!feof(in)){
  19. memset(block, 0, sizeof(block));
  20. if(fread(block, sizeof(char), BLOCK_SIZE, in) != 0){
  21. fwrite(block, sizeof(char), BLOCK_SIZE, out);
  22.  
  23. //!!!!!!!!
  24. for(int i = 0; i < BLOCK_SIZE; i++){
  25. printf("%d", block[i]);
  26. printf(" ");
  27. }
  28. printf("\n");
  29.  
  30. int mark = 0;
  31. for(int i = 0; i < BLOCK_SIZE; i++){
  32. mark += block[i]*(2 << (BLOCK_SIZE - 1 - i));
  33. }
  34. printf("%d", mark);
  35. printf("\n");
  36. }
  37. }
  38.  
  39. fclose(in);
  40. fclose(out);
  41.  
  42. //printf("%d", indexof('D'));
  43.  
  44. int p;
  45. scanf("%d", p);
  46. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:3:22: fatal error: alphabet.h: No such file or directory
 #include "alphabet.h"
                      ^
compilation terminated.
stdout
Standard output is empty