program tim_ucln;
uses crt;
var n,i:byte;
uc:longint;
a:array[1..100] of longint;
function ucln(x,y:longint):longint;
begin
while x<>y do
if x>y then x:=x-y else y:=y-x;
ucln:=x;
end;
begin
clrscr;
write('nhap n:');readln(n);
while (n<5) or (n>100) do
begin
write('nhap lai n thoa man 5<=n<=100:');
readln(n);
end;
writeln('nhap day:');
for i:=1 to n do
begin
write('a[',i,']=');readln(a[i]);
end;
uc:=ucln(a[1],a[2]);
for i:=1 to n do
uc:=ucln(uc,a[i]);
write('ucln cua tat ca phan tu cua day la:',uc);
readln;
end.