uses crt;
var a:array[1..100]of integer;
n,t,i,dem,j,kt:integer;
begin
clrscr;
write('n='); readln(n);
if (0<n) and (n<=100) then
begin
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
{----------------------cau-a-----------------}
dem:=0;
for i:=1 to n do
if (i mod 2=0) and (a[i] mod 2=1) then inc(dem);
writeln('so luong cac so le o vi tri chan la: ',dem);
{--------------------cau-b---------------------------}
t:=0;
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 t:=t+a[i];
end;
writeln('tong gia tri cac so nguyen to trong day la: ',t);
end
else writeln('vui long nhap lai');
readln;
end.
Program hotrotinhoc;
var i,n,d: byte;
t: longint;
function nt(x: byte): boolean;
var j: integer;
begin
nt:=true;
if (x=2) or (x=3) then exit;
nt:=false;
if (x=1) or (x mod 2=0) or (x mod 3=0) then exit;
j:=5;
while (j<=trunc(sqrt(x))) do
begin
if (x mod j=0) or (x mod (j+2)=0) then exit;
j:=j+6;
end;
nt:=true;
end;
begin
write('Nhap so luong phan tu : '); readln(n);
for i:=1 to n do
begin
write('a[',i,]='); readln(a[i]);
end;
d:=0; t:=0;
for i:=1 to n do
begin
if (a[i] mod 2<>0) and (i mod 2=0) then inc(d);
if nt(a[i]) then t:=t+a[i];
end;
writeln('Co ',d,' so cac so le o vi tri chan');
write('Tong gia tri cac so nguyen to trong day la : ',t);
readln
end.