program bai1;
var a:array[1..100] of longint;
s,i,n:longint;
begin
repeat
write('N= ');readln(n);
until n>0;
for i:=1 to n do
begin
write('A[',i,']= ');readln(a[i]);
end;
write('So nguyen to trong day la ');
for i:=1 to n do
begin
if (a[i] mod i=0) then s:=s+1;
if s=2 then write(a[i],' ');
end;
readln
end.
program bai_tap;
type mang = array[1..1000] of integer;
var a:mang;
i,j,n:integer;kt:boolean;
begin
writeln('nhap n:');
readln(n);
i:=1;
while i <= n do
begin
write('nhap so thu ',i,': ');
readln(a[i]);
if a[i] > 1 then
begin
kt:=true;
for j:= 2 to trunc(sqrt(a[i])) do
if a[i] mod j = 0 then
begin
kt:=false;
break;
end;
if kt = true then writeln(a[i]);
end;
inc(i);
end;
readln
end.