var a:array[1..10] of integer;
i,max,min,j,t:integer;
begin
for i:=1 to 10 do
begin
write('a[',i,']='); readln(a[i]);
end;
max:=a[1] ; min:=a[1];
for i:=2 to 10 do
begin
if max<a[i] then max:=a[i];
if min>a[i] then min:=a[i];
end;
writeln('gtln la:',max);
writeln('gtnn la:',min);
writeln('cac so chia het cho 3 o vi tri le la:');
for i:=1 to 10 do
if (a[i] mod 2=1) and (a[i] mod 3=0) then writeln(a[i],' ');
for i:=1 to 9 do
for j:=i+1 to 10 do
if a[i] > a[j] then
begin
t:=a[i]; a[i]:=a[j]; a[j]:=t;
end;
write('day so sau khi sap xep:');
for i:=1 to 10 do write(a[i]:5);
readln
end.
uses crt;
var j,tg,s,max,min,i,n:longint;
a:array[1..100000] of longint;
begin
clrscr;
write('Nhap 10 so:'); writeln;
for i:=1 to 10 do
begin
write('a[',i,']=');readln(a[i]);
end;
min:=a[1];max:=a[1];
for i:=2 to 10 do
begin
if a[i]>max then max:=a[i];
if a[i]<min then min:=a[i];
end;
write('GTLN la: ',max); write(' ');
writeln('GTNN la :',min);
for i:=1 to 10 do
if (a[i] mod 3=0) and (i mod 2<>0) then write(a[i],' '); writeln;
for i:=1 to n-1 do
for j:=i+1 to n do
if a[i]>a[j] then
begin
tg:=a[i];
a[i]:=a[j];
a[j]:=tg;
end;
for i:=1 to 10 do
write(a[i],' ');
readln
end.