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.
Program yeah;const N=15;const M=15;var A:array [1..N,1..M] of integer;i,j,b,c,x,y:integer;beginrandomize;write('матрица: ');writeln;for i:=1 to N do begin for j:=1 to M do beginA[i,j]:=random(100);write(A[i,j]:3);end;writeln;end;c:=1;while c<16 do beginfor i:=1 to N do begin for j:=1 to M do beginb:=A[1,c];end;end;x:=x+b;c:=c+1;end;writeln('сумма первой строчки: ',x);c:=1;while c<16 do beginfor i:=1 to N do begin for j:=1 to M do beginb:=A[15,c];end;end;y:=y+b;c:=c+1;end;writeln('сумма последней строчки: ',y);x:=x+y;writeln('общая сумма: ',x);end.
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.