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.
Var ma:array[1..n,1..m] of integer; ZeroCount:array[1..m] of integer; i,j,k,buf:integer; begin for i:=1 to n do for j:=1 to m do readln(ma[i][j]); writeln('Matrix:'); for i:=1 to n do begin for j:=1 to m do write(ma[i][j]:4); writeln; end; writeln('Count of zero elements:'); for j:=1 to m do begin for i:=1 to n do if ma[i][j]=0 then inc(ZeroCount[j]); writeln(j,':',ZeroCount[j]); end; for i:=1 to m-1 do for j:=i+1 to m do if ZeroCount[i]<ZeroCount[j] then begin for k:=1 to n do begin buf:=ma[k][i]; ma[k][i]:=ma[k][j]; ma[k][j]:=buf; end; buf:=ZeroCount[i]; ZeroCount[i]:=ZeroCount[j]; ZeroCount[j]:=buf; end; writeln('Final matrix:'); for i:=1 to n do begin for j:=1 to m do write(ma[i][j]:4); writeln; end; end.
Пример работы программы: Matrix: 2 0 0 -1 0 0 1 -1 -2 -2 1 -2 Count of zero elements: 1:1 2:2 3:1 4:0 Final matrix: 0 2 0 -1 0 0 1 -1 -2 -2 1 -2
ну чо тут сказать так как надо 20 символов а так ответ:3