home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / p / pascal-.zip / pascal- / tests / conformance / code next >
Encoding:
Text File  |  1993-01-01  |  1.0 KB  |  50 lines

  1. {Required input: 1
  2.  Correct output:
  3.   0 1 2 3 4 5 6 7 -8 9 10 11 12 13
  4.   1 0 1 1 0 0 1 1 0 14 15 16 17
  5. }
  6. program test9;
  7. const two = 2;
  8. type
  9.   S = array [1..10] of integer;
  10.   T = record f, g: integer end;
  11. var
  12.   a: integer;
  13.   b, c: S;
  14.   d, e: T;
  15.  
  16. procedure WriteBool(x: Boolean);
  17.   begin if x then Write(1) else Write(0) end;
  18.  
  19. procedure EchoOne;
  20.   begin Read(a); Write(a) end;
  21.  
  22. procedure P(u: integer; var v: integer);
  23.   var x: integer;
  24.   begin { u=2, v is bound to a }
  25.   EchoOne;
  26.   Write(u);
  27.   v:=3; Write(a);
  28.   x:=4; Write(x);
  29.   end;
  30.  
  31. procedure Q;
  32.   begin Write(5) end;
  33.  
  34. begin
  35. Write(0);
  36. P(two, a);
  37. Q;
  38. b[10]:=6; c:=b; Write(c[10]);
  39. d.g:=7; e:=d; Write(e.g);
  40. Write(-8); Write(8+1); Write(11-1);
  41. Write(22 div 2); Write(6*2); Write(27 mod 14);
  42. WriteBool(not false); WriteBool(false and true); WriteBool(false or true);
  43. WriteBool(1<2); WriteBool(1=2); WriteBool(1>2);
  44. WriteBool(1<=2); WriteBool(1<>2); WriteBool(1>=2);
  45. if false<true then Write(14);
  46. if false=true then Write(0) else Write(15);
  47. a:=16;
  48. while a<=17 do begin Write(a); a:=a+1 end;
  49. end.
  50.