const
m = 100;
var
n, i, k: integer;
s: real;
Y: array[1..m] of real;
begin
read(n);
s := 0;
k := 0;
for i := 1 to n do
read(Y[i]);
if (i mod 2 = 0) and (Y[i] > 0) then
s := s + Y[i];
k := k + 1;
end;
s := s / k;
write(s);
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
const
m = 100;
var
n, i, k: integer;
s: real;
Y: array[1..m] of real;
begin
read(n);
s := 0;
k := 0;
for i := 1 to n do
begin
read(Y[i]);
if (i mod 2 = 0) and (Y[i] > 0) then
begin
s := s + Y[i];
k := k + 1;
end;
end;
s := s / k;
write(s);
end.