tbs0233.pp 548 B

12345678910111213141516171819202122232425262728293031
  1. program except_test;
  2. type byteset = set of byte;
  3. enumset = set of (zero,one,two,three);
  4. function test(s : byteset) : boolean;
  5. begin
  6. test:=false;
  7. if 0 in s then
  8. begin
  9. Writeln('Contains zero !');
  10. test:=true;
  11. end;
  12. end;
  13. function testenum(s : enumset) : boolean;
  14. begin
  15. testenum:=false;
  16. if zero in s then
  17. begin
  18. Writeln('Contains zero !');
  19. testenum:=true;
  20. end;
  21. end;
  22. begin
  23. if test([1..5,8]) then halt(1);
  24. if not test([0,8,15]) then halt(1);
  25. if not testenum([zero,two]) then halt(1);
  26. end.