Last change
on this file since 188 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:
510 bytes
|
Rev | Line | |
---|
[2] | 1 | { This program is correct wrt the context-free grammar; it tests
|
---|
| 2 | for correct scanning of numerals }
|
---|
| 3 |
|
---|
| 4 | program example;
|
---|
| 5 |
|
---|
| 6 | var x, y: integer;
|
---|
| 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; y := readinteger;
|
---|
| 15 | writeinteger(gcd(x, y));
|
---|
| 16 | a := 3;
|
---|
| 17 | a := 3.5;
|
---|
| 18 | a := 3E3;
|
---|
| 19 | a := 2.563E776;
|
---|
| 20 | a := 1E1;
|
---|
| 21 | a := 0.150E30;
|
---|
| 22 | a := -1.3E+13;
|
---|
| 23 | a := 3.2534E-035;
|
---|
| 24 | a := -0.02E-30;
|
---|
| 25 | a := 35E-5;
|
---|
| 26 | a := a
|
---|
| 27 | end.
|
---|
Note:
See
TracBrowser
for help on using the repository browser.