uses crt;
var a,b:array[1..100]of integer;
i,n,dem,t,dem1,max,tam,j,kt:integer;
begin
clrscr;
write('Nhap n='); readln(n);<br />for i:=1 to n do<br />begin<br />write('A[',i,']='); readln(a[i]);
end;
dem:=0;
for i:=1 to n do
if a[i] mod 2<>0 then inc(dem);
writeln('So luong so le la: ',dem);
t:=0;
for i:=1 to n do
if a[i] mod 5=0 then t:=t+a[i];
writeln('Tong cac phan tu chia het cho 5 la: ',t);
dem1:=0;
for i:=1 to n do
if a[i] mod 2=0 then
begin
inc(dem1);
b[dem1]:=a[i];
end;
max:=b[1];
for i:=1 to dem1 do
if max<b[i] then max:=b[i];
writeln('Phan tu chan lon nhat la: ',max);
writeln('Vi tri cua no trong mang la: ');
for i:=1 to n do
if max=a[i] then write(i:4);
writeln;
for i:=1 to n-1 do
for j:=i+1 to n do
if a[i]>a[j] then
begin
tam:=a[i];
a[i]:=a[j];
a[j]:=tam;
end;
writeln('Mang duoc sap xep tang dan la: ');
for i:=1 to n do
write(a[i]:4);
writeln;
writeln('Cac so nguyen to trong day la: ');
for i:=1 to n do
if a[i]>1 then
begin
kt:=0;
for j:=2 to a[i]-1 do
if a[i] mod j=0 then kt:=1;
if kt=0 then write(a[i]:4);
end;
readln;
end.