Lời giải:
program hotrotinhoc;
var a,b : integer;
Function UCLN(x,y: integer): integer;
var z: integer;
begin
while y<>0 do
begin
z:= x mod y;
x:=y;
y:=z;
end;
ucln:=x;
end;
begin
readln(a);
readln(b);
write(ucln(a,b));
readln
end.