Первая
Код:
Program DZ1; type matr=array[1..7,1..6] of real; var a,b,c,d,e:matr; i,j,k:byte; p,m,max:real; q,s:integer; Procedure vivod (ch:char;M:MATR;N:byte); Begin writeln ('Matrica ',ch); For i:=1 to 7 do Begin For j:=1 to 6 do write(m[i,j]:8:n); writeln end; readln end; Procedure vivod1 (ch:char;M:MATR;N:byte); Begin writeln ('Matrica ',ch); For i:=1 to 6 do Begin For j:=1 to 6 do write(m[i,j]:8:n); writeln end; readln end; Begin For i:=1 to 7 do For j:=1 to 6 do a[i,j]:=i+sqrt(j)/cos(i); vivod ('A',a,2); max:=a[1,1]; For i:=1 to 7 do for j:=1 to 6 do if max<a[i,j] then Begin s:=i; max:=a[i,j]; end; writeln('Maxsimalniy element v stroke',s:2); For i:=1 to 7 do for j:=1 to 6 do If s>i then b[i,j]:=a[i,j] else b[i,j]:=a[i+1,j]; vivod1('B',b,2); for i:=1 to 6 do for j:=1 to 6 do c[i,j]:=0; for i:=1 to 6 do for j:=1 to 6 do Begin If j=i then c[i,j]:=i; if j<i then c[i,j]:=1; end; vivod1('C',c,2); for i:=1 to 6 do for j:=1 to 6 do begin d[i,j]:=0; for k:=1 to 6 do d[i,j]:=d[i,j]+b[i,k]*c[k,j]; end; vivod1('D',d,2); e:=d; For i:=1 to 2 do For j:=1 to 2 do e[i,j]:=d[i,j+2]; For i:=3 to 4 do For j:=3 to 4 do e[i,j]:=d[i,j-2]; For i:=5 to 6 do For j:=3 to 4 do e[i,j]:=d[i,j+2]; For i:=5 to 6 do For j:=5 to 6 do e[i,j]:=d[i,j-2]; vivod1('E',e,2); m:=0; For i:=1 to 6 do Begin j:=i; m:=m+e[i,j]; end; m:=m/6; write('Sredne arifmeticheskoe glavnoy diagonali ravno= ',m:2:2); readln; end.