tisobuf2.pp 420 B

123456789101112131415161718192021222324
  1. { %OPT=-Sr }
  2. {$mode iso}
  3. program test(input, output, testfile);
  4. var
  5. testfile : text;
  6. s : array[1..100] of char;
  7. begin
  8. rewrite(testfile);
  9. writeln(testfile,'Hello world');
  10. close(testfile);
  11. assign(testfile,'testfile.txt');
  12. reset(testfile);
  13. readln(testfile,s);
  14. if (s[1]<>'H') or (s[2]<>'e') then
  15. halt(1);
  16. close(testfile);
  17. erase(testfile);
  18. writeln('ok');
  19. end.