Const n=30;
var a:array[1..n] of integer;
i,min,max,s:integer; sr:real;
begin
Randomize;
writeln('Массив A:');
for i:=1 to n do
begin
a[i]:=random(11)+10;
write(a[i]:6);
end;
writeln;
min:=a[1]; max:=a[1];
s:=a[1];
for i:=2 to n do
begin
if a[i] if a[i]>max then max:=a[i];
s:=s+a[i];
end;
sr:=s/n;
writeln('min = ',min,' max = ',max,' sr = ',sr);
s:=0;
for i:=1 to n do write(a[i]-sr:6:1);
end.
Пример (для 10 дней):
Массив A:
11 16 19 15 13 19 11 16 17 17
min = 11 max = 19 sr = 15.4
-4.4 0.6 3.6 -0.4 -2.4 3.6 -4.4 0.6 1.6 1.6