Первая
Код:
Program DZ1; type matr=array[1..6,1..6] of real; var a,b,c,d,e:matr; i,j,k,imax,imin:byte; max,min,max2,max3,p:real; n,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]:=(j*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[i,k]) then begin p:=b[i,j]; b[i,j]:=b[i,k]; b[i,k]:=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 Begin j:=i; c[i,j]:=i; 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:=4 to 6 do For j:=1 to 3 do e[i,j]:=d[i,j+3]; For i:=4 to 6 do For j:=4 to 6 do e[i,j]:=d[i,j-3]; vivod('E',e,2); For i:=1 to 6 do For j:=1 to 6 do if e[i,j]<0 then q:=q+1; write('Kolichestvo otricatelnih elementov = ',q:2); readln; end.
Вторая
Код:
Program DZ2; const ni=11; mj=12; lk=9; 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:=(sqr(x)+sqr(y))/(x+y); end; function p(r:integer):real; begin if r=1 then p:=sin(z) else p:=z*sqr(p(r-1))+sqrt(abs(p(r-1)+1)); end; function h(r:integer):real; begin if r=1 then h:=cos(z) else h:=z*h(r-1)/3; end; procedure s_m(si:integer;var ms:mas;Sm:char); begin writeln('Ischodniy 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('Polu4eniy Massiv ',Sm); for r:=1 to si do begin if ms[r]>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,t)+sqrt(s*t); b:=sqrt(s)+f(s,sqrt(t)); writeln('a = ',a:5:2,' b = ',b:5:2); write('Vvedite z: '); readln(z); c:=sqrt(p(5))+h(8); writeln('c = ',c:6:2); s_m(ni,n,'N'); s_m(mj,m,'M'); s_m(lk,l,'L'); deyst(ni,n,'N',a); deyst(mj,m,'M',b); deyst(lk,l,'L',c); readln End.