Const N = 10; Var A:array[1..n,1..n] of integer i,min,max,j: integer; Begin Randomize; For i:=1 to n do begin For j:=1 to n do begin A[i,j]:= random(50); Write(a[i,j]:4); End; Writeln; End; Writeln; Max:=a[1,1]; min:=a[1,1]; For i:=1 to n do begin If a[i,i] > max then max:= a[i,i]; If a[i,i] < min then min:= a[i,i]; End; Write(max,' ',min); End.
N = 10;
Var
A:array[1..n,1..n] of integer
i,min,max,j: integer;
Begin
Randomize;
For i:=1 to n do begin
For j:=1 to n do begin
A[i,j]:= random(50);
Write(a[i,j]:4);
End;
Writeln;
End;
Writeln;
Max:=a[1,1]; min:=a[1,1];
For i:=1 to n do begin
If a[i,i] > max then max:= a[i,i];
If a[i,i] < min then min:= a[i,i];
End;
Write(max,' ',min);
End.