tset3.pp 915 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. {$packset 1}
  2. type
  3. tmini = 0..7;
  4. tminiset = set of tmini;
  5. procedure do_error(w : word);
  6. begin
  7. writeln('Error: ',w);
  8. halt(1);
  9. end;
  10. var
  11. s1,s2,s3 : tminiset;
  12. b : byte;
  13. m : tmini;
  14. begin
  15. s1:=[];
  16. if s1<>[] then
  17. do_error(1);
  18. s1:=[1];
  19. if s1<>[1] then
  20. do_error(2);
  21. s2:=[2,3];
  22. if s2<>[2,3] then
  23. do_error(3);
  24. b:=6;
  25. s3:=[b,7];
  26. if s3<>[6,7] then
  27. do_error(4);
  28. s1:=s1+s2;
  29. if s1<>[1..3] then
  30. do_error(5);
  31. s2:=s1;
  32. if not(s1=s2) then
  33. do_error(6);
  34. s3:=[4];
  35. include(s1,4);
  36. if s1<>[1..4] then
  37. do_error(7);
  38. s2:=s1;
  39. exclude(s1,4);
  40. if s1<>[1..3] then
  41. do_error(8);
  42. s2:=s2-s3;
  43. if s1<>s2 then
  44. do_error(9);
  45. b:=4;
  46. include(s1,b);
  47. if s1<>[1..4] then
  48. do_error(10);
  49. s2:=s2+[b];
  50. if s1<>s2 then
  51. do_error(11);
  52. s2:=s1;
  53. m:=3;
  54. s1:=s1-[m];
  55. exclude(s2,m);
  56. if s1<>s2 then
  57. do_error(12);
  58. writeln('ok');
  59. end.