source: liacs/coco/tests/simple/correct1.p0@ 2

Last change on this file since 2 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: 279 bytes
Line 
1{ This is the example given in the Dragon book }
2program example;
3
4var x, y: integer;
5
6
7function gcd(a,b: integer): integer;
8begin
9 if b = 0 then gcd := a
10 else gcd := gcd(b, a mod b)
11end;
12
13begin
14 x := readinteger;
15 y := readinteger;
16 writeinteger(gcd(x, y))
17end.
Note: See TracBrowser for help on using the repository browser.