uses crt; var i, k: integer; a,k2: real; mas, ma: array [1..10] of integer; begin randomize; write (' razmer massiva = '); readln (k); for i:=1 to k do mas[i]:= random (10); for i:=1 to k do write (mas[i],' '); for i:=1 to k do if i mod 2<>0 then a:= mas[i]+a; writeln; if k mod 2<> 0 then begin k:=k+1; k2:= k/2; end else k2:= k/2; a:= a/k2; write ('sredn znach = ',a); readkey; end.
uses crt;
var
i, k: integer;
a,k2: real;
mas, ma: array [1..10] of integer;
begin
randomize;
write (' razmer massiva = '); readln (k);
for i:=1 to k do
mas[i]:= random (10);
for i:=1 to k do
write (mas[i],' ');
for i:=1 to k do
if i mod 2<>0 then a:= mas[i]+a;
writeln;
if k mod 2<> 0 then begin k:=k+1; k2:= k/2; end else k2:= k/2;
a:= a/k2;
write ('sredn znach = ',a);
readkey;
end.