1 câu trả lời
đáp án:
var a:array[1..100000000] of longint;
k,i,n,d:longint;
function uc(x,y:longint):longint;
var r:longint;
begin
x:=abs(x);
y:=abs(y);
while y<>0 do
begin
r:=x mod y;
x:=y;
y:=r;
end;
uc:=x;
end;
function bc(x2,y2:longint):longint;
begin
bc:=x2 div uc(x2,y2)*y2;
end;
begin
read(n);
for i:=1 to n do readln(a[i]);
for i:=1 to n do
k:=bc(a[1],a[2]);
for i:=3 to n do
k:=bc(a[i],k);
write(k);
end.
án: