Câu trả lời:
uses crt;
var
n,i,dem:integer;
a:array[1..20] of integer;
function ngto(n:integer):boolean;
var i:integer; ok:boolean;
begin
if n<2 then ok:=false;
for i:=2 to trunc(sqrt(n)) do
if n mod i=0 then ok:=false else ok:=true;
ngto:=ok;
end;
begin
clrscr;
write('nhap so phan tu cua day: '); readln(n);
for i:=1 to n do
begin
write('nhap phan tu thu [',i,']= ]); readln(a[i]);
end;
dem:=0;
for i:=1 to n do
if ngto(a[i]) then inc(dem);
write("trong day co ',dem,' phan tu la so nguyen to');
readln
end.