Найти среднее арифметическое 6 рандомных чисел до 100 в массиве.паскаль
Answers & Comments
larinfo
Program zadacha;vara: array[1..6] of integer;i: integer;sr: real; beginfor i:=1 to 6 do begina[i]:=random(100);write(a[i]:6);end; sr:=0;for i:=1 to 6 do beginsr:=sr+a[i];end; writeln();sr:= sr/6;writeln('sr=', sr:6:2);end.
Answers & Comments
beginfor i:=1 to 6 do begina[i]:=random(100);write(a[i]:6);end;
sr:=0;for i:=1 to 6 do beginsr:=sr+a[i];end;
writeln();sr:= sr/6;writeln('sr=', sr:6:2);end.