comparison lab2/pascal.p @ 0:bfdcc3820b32

Basis
author Mike Spivey <mike@cs.ox.ac.uk>
date Thu, 05 Oct 2017 08:04:15 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:bfdcc3820b32
1 (* lab2/pascal.p *)
2
3 var a: array 5 of array 5 of integer;
4 var i, j: integer;
5
6 begin
7 i := 0;
8 while i < 5 do
9 a[i][0] := 1; j := 1;
10 print a[i][0];
11 while j <= i do
12 a[i][j] := a[i-1][j-1] + a[i-1][j];
13 print a[i][j];
14 j := j+1
15 end;
16 newline;
17 i := i+1
18 end
19 end.
20
21 (*<<
22 1
23 1 1
24 1 2 1
25 1 3 3 1
26 1 4 6 4 1
27 >>*)