uses crt; var i,n,a,b, uc,bcnn:integer ;
c:array[1..100] of integer;
{--- CTC tim UCLL hai so} function ucln(a,b:integer):integer;
var r:integer;
begin r:=a mod b;
while r<>0 do begin a:=b; b:=r; r:= a mod b;
end;
ucln:=b;
end;
{--- CTC chinh----} begin Write('n= ');
readln(n);
for i:=1 to n do begin write('c[',i,']=');
readln(c[i]);
end;
for i:= 1 to n do
Write(c[i]:3);
writeln;
uc:=ucln(c[1], c[2]);
bcnn:=(c[1]*c[2])div uc;
for i:=3 to n do begin uc:=ucln(uc,c[i]);
bcnn:= bcnn*c[i] div uc;
end;
Writeln('bcnn =',bcnn); readln; end.
var i,n,min,max:integer;
a:array[1..1000] of integer;
begin
Write('n=');read(n);
for i:=1 to n do
Read(a[i]);
i:=1;
max:=0;
min:=a[i];
while i<n do
Begin
if a[i] > max then max:=a[i];
if a[i] <min then min:=a[i];
i:=i+1;
end;
writeln('Gia tri LN la:',max);
writeln('Gia tri NN la:',min);
readln;
end.
uses crt;
var a:array[1..100]of integer;
i,n,max,min:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
max:=a[1];
min:=a[1];
for i:=1 to n do
begin
if max<a[i] then max:=a[i];
if min>a[i] then min:=a[i];
end;
writeln('So lon nhat la: ',max);
writeln('So be nhat la: ',min);
readln;
end.