tbs0009.pp 601 B

123456789101112131415161718192021222324252627
  1. var c:byte;
  2. Procedure a(b:boolean);
  3. begin
  4. if b then writeln('TRUE') else writeln('FALSE');
  5. end;
  6. function Test_a(b:boolean) : string;
  7. begin
  8. if b then Test_a:='TRUE' else Test_a:='FALSE';
  9. end;
  10. begin {main program}
  11. a(true); {works}
  12. if Test_a(true)<>'TRUE' then halt(1);
  13. a(false); {works}
  14. if Test_a(false)<>'FALSE' then halt(1);
  15. c:=0;
  16. a(c>0); {doesn't work}
  17. if Test_a(c>0)<>'FALSE' then halt(1);
  18. a(c<0); {doesn't work}
  19. if Test_a(c<0)<>'FALSE' then halt(1);
  20. a(c=0);
  21. if Test_a(c=0)<>'TRUE' then halt(1);
  22. end.