Uses crt; const n=20; var i,average,count:integer; a:array[1..n] of integer; begin randomize; writeln('Введите элементы массива:'); for i:=1 to n do begin read(a[i]); if i mod 2<>0 then begin average:=average+a[i]; inc(count); end; end; writeln(average DIV count); end.
const n=20;
var i,average,count:integer;
a:array[1..n] of integer;
begin
randomize;
writeln('Введите элементы массива:');
for i:=1 to n do
begin
read(a[i]);
if i mod 2<>0 then
begin
average:=average+a[i];
inc(count);
end;
end;
writeln(average DIV count);
end.