Lời giải :
program hotrotinhoc l
var a : array[1..32000] of integer ;
N,i : integer ;
function NT(n:longint) : boolean ;
var i: longint ;
kt : boolean ;
begnin
kt:= true;
for i:= 2 to round(sqrt(n)) do
if n mod i=0 then kt:= false ;
NT:=kt ;
end;
begin
write('Nhap do dai cua mang'); readln(n);
writeln('Nhap gia tri cua cac phan tu');
for i:= 1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
for i:= 1 to n do
begin
if (a[i]>2) and NT(a[i]) then write('trong mang co so nguyen to') else write('trong mang khong co so nguyen to');
if (a[i]>2) and NT(a[i]) then write('Cac so nguyen to trong mang la:',A[i]:5);
end;
readln
end.