Const N = 3; Var A:Array[1..N,1..N] of integer; i,j:integer; Begin Randomize; WriteLn('Исходный массив:'); For i:= 1 to N do Begin For j:= 1 to N do Begin A[i,j]:=random(21)-10; Write(A[i,j]:3,' ') End; WriteLn End; WriteLn('↓↓↓↓↓↓↓↓↓↓↓↓↓'); For i:= 1 to N do A[i,i]:=5; For i:= 1 to N do Begin For j:= 1 to N do Write(A[i,j]:3,' '); WriteLn End; End.
N = 3;
Var
A:Array[1..N,1..N] of integer;
i,j:integer;
Begin
Randomize;
WriteLn('Исходный массив:');
For i:= 1 to N do
Begin
For j:= 1 to N do
Begin
A[i,j]:=random(21)-10;
Write(A[i,j]:3,' ')
End;
WriteLn
End;
WriteLn('↓↓↓↓↓↓↓↓↓↓↓↓↓');
For i:= 1 to N do
A[i,i]:=5;
For i:= 1 to N do
Begin
For j:= 1 to N do
Write(A[i,j]:3,' ');
WriteLn
End;
End.