home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-387-Vol-3of3.iso
/
p
/
pascal-.zip
/
pascal-
/
tests
/
conformance
/
gcd
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1992-11-29
|
188 b
|
14 lines
{Greatest common divisor}
program GCD;
var
x,y: integer;
begin
read(x);
while x<>0 do
begin read(y);
while x<>y do if x>y then x:=x-y else y:=y-x;
write(x);
read(x);
end;
end.