Первая
Код:
Program DZ1; type matr=array[1..6,1..6] of real; var a,b,c,d,e:matr; i,j,k:byte; p,max:real; q:integer; Procedure vivod (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 6 do For j:=1 to 6 do a[i,j]:=i*sin(j)/cos(i); vivod ('A',a,2); b:=a; For i:=1 to 6 do for j:=1 to 6 do for k:=1 to 6 do begin If(b[i,j]>b[k,j]) then begin p:=b[i,j]; b[i,j]:=b[k,j]; b[k,j]:=p; end; end; vivod('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 i=j then c[i,j]:=6; if j<i then Begin c[i,j]:=6-i+j; end; end; vivod('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; vivod('D',d,2); e:=d; For i:=1 to 3 do For j:=1 to 3 do e[i,j]:=d[i+3,j+3]; For i:=4 to 6 do For j:=4 to 6 do e[i,j]:=d[i-3,j-3]; vivod('E',e,2); max:=e[1,1]; q:=i; For i:=1 to 6 do For j:=1 to 6 do if max<e[i,j] then Begin q:=i; max:=e[i,j]; end; write('Nomer stroki s max elementom= ',q:2); readln; end.
Вторая
Код:
program dz2; const ni=12; mj=11; lk=10; type mas=array[1..15] of real; var s,t,a,b,z,c:real; n,m,l:mas; i,j,k,r:integer; function f(x,y:real):real; begin f:=abs(x+sqr(y))/sqrt(x+y); end; function p(r:integer):real; begin if r=1 then p:=sin(0.2) else p:=sin(p(r-1))+p(r-1); end; function h(r:integer):real; begin if r=1 then p:=cos(1.2) else h:=sin(h(r-1))-h(r-1); end; procedure s_m(i:integer;var ms:mas;sm:char); begin writeln('Ishodniy massiv',sm); for r:=1 to si do begin ms[r]:=random(5)-r; write(ms[r]:3:0); end; readln; writeln; end; procedure deyst(si:integer; ms:mas; sm:char; abc:real;); begin writeln('Polucheniy massiv',sm); for r:=1 to si do begin if frac(ms[r]/3)=0 then Begin ms[r]:=ms[r]*abc; end; write(ms[r]:7:2); end; readln; writeln; end; Begin randomize; write('Vvedite s,t: '); readln(s,t); a:=f(s-5,t-1); b:=sqrt(s)+f(sqrt(s),t/2); writeln('a= ',a:5:2,'b= ',b:5:2); write('Vvedite z: '); readln(z); c:=sqrt(p(5)+h(7)); writeln('c= ',c:6:2); s_m(nj,n,'N'); s_m(mj,m,'M'); s_m(lk,l,'L'); deyst(nj,n,'N',a); deyst(mj,m,'M',b); deyst(lk,l,'L',c); readln End.