source: liacs/coco/tests/code-generation/fibo2.p0@ 281

Last change on this file since 281 was 2, checked in by Rick van der Zwet, 15 years ago

Initial import of data of old repository ('data') worth keeping (e.g. tracking
means of URL access statistics)

File size: 387 bytes
Line 
1program fibonee;
2
3var
4 hlp: integer;
5
6function fibo(i: integer): integer;
7
8var hlp1, hlp2: integer;
9
10begin
11 writeinteger(i);
12 if (i <= 1) then
13 begin
14 { writeinteger(-1); }
15 fibo := 1
16 end
17 else
18 begin
19 hlp1 := fibo(i-1);
20 hlp2 := fibo(i-2);
21 { writeinteger(-(hlp1+hlp2)); }
22 fibo := hlp1 + hlp2
23 end
24end;
25
26
27begin
28 hlp := fibo(12);
29 writeinteger(hlp)
30end.
Note: See TracBrowser for help on using the repository browser.