Объяснение:
в секцию var добавляем
AverageValue : real;
в нашу обработку пишем:
AverageValue :=0;
for i:=1 to 10 do AverageValue := AverageValue + a[i];
WriteLn('Average Value = ', AverageValue/10 );
program ni;
var
i: integer;
average: real;
a: array[1..10] of integer;
begin
randomize;
for i:= 1 to 10 do a[i]:= random(100);
for i:= 1 to 10 do write(a[i], " ");
average:= 0;
for i:= 1 to 10 do average:= average + a[i];
writeln(average)
end.
Объяснение:
в секцию var добавляем
AverageValue : real;
в нашу обработку пишем:
AverageValue :=0;
for i:=1 to 10 do AverageValue := AverageValue + a[i];
WriteLn('Average Value = ', AverageValue/10 );
program ni;
var
i: integer;
average: real;
a: array[1..10] of integer;
begin
randomize;
for i:= 1 to 10 do a[i]:= random(100);
for i:= 1 to 10 do write(a[i], " ");
average:= 0;
for i:= 1 to 10 do average:= average + a[i];
writeln(average)
end.