comparison lab2/array.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/array.p *)
2
3 var a: array 10 of integer;
4 var i: integer;
5
6 begin
7 i := 2; a[0] := 1; a[1] := 1;
8 while i < 10 do
9 a[i] := a[i-2] + a[i-1];
10 i := i+1
11 end;
12 i := 0;
13 while i < 10 do
14 print a[i]; newline;
15 i := i+1;
16 end
17 end.
18
19 (*<<
20 1
21 1
22 2
23 3
24 5
25 8
26 13
27 21
28 34
29 55
30 >>*)