USES CRT;
var a: array[1..100] of integer;
s,n,i,dem: integer;
Const Max = 500;
Function NT(n:integer):boolean;
Var i:integer;
Begin
If (n=0) Or (n=1) then NT:=False
Else Begin
i:=2;
While (n mod i <> 0) and (i<Sqrt(n)) do i:=i+1;
If i>Sqrt(n) then NT:=True
Else Nt:=False;
End;
End;
begin
randomize;
clrscr;
write('Nhap so phan tu: '); readln(n);
for i:=1 to n do a[i]:=random(2020);
for i:=1 to n do write(a[i],' ');
for i:=1 to n do if a[i]=19 then inc(dem);
write('Trong day co: ',dem,' so 19');
writeln;
write('Cac so la boi cua 19: ');
for i:=1 to n do if a[i] mod 19=0 then write(a[i],' ');
writeln;
write('Cac so nguyen to trong mang: ');
For i:=1 to n do If NT(A[i]) then write(a[i],' ');
readln;
end.