Const
N = 13;
Var
A:array[1..N] of integer;
i,Min,Max:integer;
Begin
Write('Исходный массив: ');
For i:= 1 to N do
Begin
A[i]:=Random(21)-10;
Write(A[i],' ')
End;
WriteLn;
Min:=A[N];
Max:=A[N];
For i:= 1 to N-1 do
Begin
if A[i]>Max then Max:=A[i];
if A[i] End;
WriteLn('Max = ',Max);
WriteLn('Min = ',Min);
WriteLn('Max - Min = ',Max-Min);
End.
Пример:
Исходный массив: -1 5 -8 -2 3 -2 -3 10 -10 -8 -4 5 -3
Max = 10
Min = -10
Max - Min = 20