const n=5; m=6;var a:array[1..n,1..m] of integer;i,j,max,imax,jmax,s:integer;beginRandomize;writeln('Исходный массив:');for i:=1 to n do begin for j:=1 to m do begin a[i,j]:=random(100); write(a[i,j]:4); end; writeln; end;max:=a[1,1]; imax:=1; jmax:=1;for i:=1 to n do for j:=1 to m do if a[i,j]>max then begin max:=a[i,j]; imax:=i; jmax:=j; end;writeln('max = a[',imax,',',jmax,'] = ',max);s:=0;for i:=1 to imax-1 do for j:=1 to m do s:=s+a[i,j];for j:=1 to jmax-1 do s:=s+a[imax,j];writeln('s = ',s);end.Пример:Исходный массив: 75 39 34 25 29 87 57 12 73 49 75 21 48 99 16 57 23 43 74 70 13 2 35 44 21 49 90 91 12 38max = a[3,2] = 99s = 624