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