// PascalABC.NET 3.0, сборка 1073 const nn=30; mm=30; var a:array[1..mm,1..nn] of integer; m,n,i,j,k,s:integer; begin Writeln('Введите число строк и столбцов массива: '); Read(m,n); Randomize; Writeln('*** Исходный массив ***'); k:=0; for i:=1 to m do begin for j:=1 to n do begin a[i,j]:=Random(51)-25; Write(a[i,j]:4); if Odd(a[i,j]) then Inc(k) end; Writeln end; if k>5 then begin Writeln('Средние арифметические отрицательных элементов по строкам'); for i:=1 to m do begin s:=0; k:=0; for j:=1 to n do if a[i,j]<0 then begin Inc(k); s:=s+a[i,j] end; if k>0 then Writeln(s/k:9:5) else Writeln(' 0.00000'); end end else begin Writeln('*** Результирующий массив ***'); for i:=1 to m do begin for j:=1 to n do begin a[i,j]:=2*a[i,j]; Write(a[i,j]:4) end; Writeln end end end.
Uses GraphABC; procedure Draw(x, y, l, u : Real; t : Integer);
procedure Draw2(Var x, y: Real; l, u : Real; t : Integer); begin Draw(x, y, l, u, t); x := x + l*cos(u); y := y - l*sin(u);end; begin if t > 0 then beginl := l/3;Draw2(x, y, l, u, t-1);Draw2(x, y, l, u+pi/3, t-1); Draw2(x, y, l, u-pi/3, t-1);Draw2(x, y, l, u, t-1);end else Line(Round(x), Round(y), Round(x+cos(u)*l), Round(y-sin(u)*l))end; begin SetWindowSize(425,500); SetWindowCaption('Фракталы: Снежинка Коха'); Draw(10, 354, 400, pi/3, 4);Draw(410, 354, 400, pi, 4); Draw(210, 8, 400, -pi/3, 4);end.