program xyz;
var
D: array [1..25] of Integer;
i, imin, imax, amin, amax, s, p: Integer;
aver: Double;
begin
Randomize;
WriteLn ('Массив:');
for i := Low (D) to High (D) do begin
D [i] := Random (101);
Write (D [i], ' ');
end;
imin := Low (D);
imax := Low (D);
amin := D [Low (D)];
amax := D [Low (D)];
s := 0;
s := s + D [i];
if D [i] < amin then begin
amin := D [i];
imin := i;
if D [i] > amax then begin
amax := D [i];
imax := i;
Aver := s / 25;
p := 1;
if D [i] > Aver then
p := p * D [i];
WriteLn;
WriteLn ('Минимальное значение = ', amin);
WriteLn ('Индекс = ', imin);
WriteLn ('Максимальное значение = ', amax);
WriteLn ('Индекс = ', imax);
WriteLn ('Среднее арифметическое = ', aver :10 :5);
WriteLn ('Произведение = ', p);
ReadLn;
end.
program xyz;
var
D: array [1..25] of Integer;
i, imin, imax, amin, amax, s, p: Integer;
aver: Double;
begin
Randomize;
WriteLn ('Массив:');
for i := Low (D) to High (D) do begin
D [i] := Random (101);
Write (D [i], ' ');
end;
imin := Low (D);
imax := Low (D);
amin := D [Low (D)];
amax := D [Low (D)];
s := 0;
for i := Low (D) to High (D) do begin
s := s + D [i];
if D [i] < amin then begin
amin := D [i];
imin := i;
end;
if D [i] > amax then begin
amax := D [i];
imax := i;
end;
end;
Aver := s / 25;
p := 1;
for i := Low (D) to High (D) do begin
if D [i] > Aver then
p := p * D [i];
end;
WriteLn;
WriteLn ('Минимальное значение = ', amin);
WriteLn ('Индекс = ', imin);
WriteLn ('Максимальное значение = ', amax);
WriteLn ('Индекс = ', imax);
WriteLn ('Среднее арифметическое = ', aver :10 :5);
WriteLn ('Произведение = ', p);
ReadLn;
end.