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]<Min then Min:=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
Var n:integer;
begin
readln(n);
var ar:=readarrinteger(n);
for var i:=0 to n-1 do if (ar[i]<=437)
then begin write('Crash ',i+1); exit; end;
write('No crash');
end.
512 байт= 4096 бит=0,5 Кбайт