Const
N = 20;
Var
A:array[1..N] of integer;
i,M:integer;
Begin
Randomize;
Write('Исходный массив:');
M:=1;
For i:= 1 to N do
Begin
A[i]:=random(N+1);
Write(' ',A[i]);
if A[i] > A[M] then M:=i;
End;
WriteLn;
WriteLn('Max = ',A[M],'[',M,']');
if M < N then
For i:= M to N-1 do
A[i]:=A[i+1];
M:=1;
For i:= 1 to N-1 do
if A[i] < A[M] then M:=i;
WriteLn('Min = ',A[M],'[',M,']');
if M < N then
For i:= M to N-1 do
A[i]:=A[i+1];
Write('После удаления Max и Min:');
For i:= 1 to N-2 do
Write(' ',A[i])
End.
Const
N = 3;
M = 4;
Var
A,B,C:array[1..N,1..M] of shortint;
i,j,Max,t:integer;
Begin
Randomize;
WriteLn('Матрица A:');
For i:= 1 to N do
Begin
For j:= 1 to M do
Begin
A[i,j]:=random(19)-9;
Write(A[i,j]:2,' ')
End;
WriteLn
End;
WriteLn('Матрица B:');
For i:= 1 to N do
Begin
For j:= 1 to M do
Begin
B[i,j]:=random(19)-9;
Write(B[i,j]:2,' ');
End;
WriteLn
End;
WriteLn('A+B:');
For i:= 1 to N do
Begin
For j:= 1 to M do
Begin
C[i,j]:=A[i,j]+B[i,j];
Write(C[i,j]:3,' ');
End;
WriteLn
End;
For i:= 1 to N do
Begin
Max:=i;
For j:= i+1 to M do
if C[1,j] > C[1,Max] then Max:=j;
For j:= 1 to N do
Begin
t:=C[j,Max];
C[j,Max]:=C[j,i];
C[j,i]:=t
End;
End;
WriteLn('Матрица C:');
For i:= 1 to N do
Begin
For j:= 1 to M do
Write(C[i,j]:3,' ');
WriteLn
End;
ReadLn
End.