Last change
on this file since 43 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:
394 bytes
|
Rev | Line | |
---|
[2] | 1 | { This program is correct wrt the CF grammar. }
|
---|
| 2 |
|
---|
| 3 | program example;
|
---|
| 4 |
|
---|
| 5 | var x, y, x: integer; { x is redeclared within one var statement }
|
---|
| 6 | function gcd(a,b: integer): integer;
|
---|
| 7 | var c: integer;
|
---|
| 8 | var d,e,f: integer;
|
---|
| 9 | var c: integer; { c is redeclared }
|
---|
| 10 | begin
|
---|
| 11 | if b = 0 then gcd := a
|
---|
| 12 | else gcd := gcd(b, a mod b)
|
---|
| 13 | end;
|
---|
| 14 |
|
---|
| 15 | begin
|
---|
| 16 | x := readinteger; y := readinteger;
|
---|
| 17 | writeinteger(gcd(x, y))
|
---|
| 18 | end.
|
---|
Note:
See
TracBrowser
for help on using the repository browser.