а)
uses crt;
var n,i,sum:integer;
a:array[1..100] of integer;
begin
writeln('N?');
read(n);
writeln('Элементы?');
for i:=1 to n do
read(a[i]);
for i:=1 to n div 2 do
sum:=sum+a[i];
writeln(sum);
end.
б)
uses crt;
var n,i,sum:integer;
a:array[1..100] of integer;
begin
writeln('N?');
read(n);
writeln('Элементы?');
for i:=1 to n do
begin
read(a[i]);
if i mod 2=0 then
sum:=sum+a[i];
end;
writeln(sum);
end.
в)
uses crt;
var n,i,mult:integer;
a:array[1..100] of integer;
begin
mult:=1;
writeln('N?');
read(n);
writeln('Элементы?');
for i:=1 to n do
begin
read(a[i]);
if i mod 2<>0 then
mult:=mult*a[i];
end;
writeln(mult);
end.
г)
uses crt;
var n,i,sum:integer;
a:array[1..100] of integer;
begin
writeln('N?');
read(n);
writeln('Элементы?');
for i:=1 to n do
begin
read(a[i]);
if (i mod 2=0) and (a[i] mod 2=0) then
sum:=sum+a[i];
end;
writeln(sum);
end.