begin x := -50; while x <= 50 do begin y:=(x + 4) * (x + 4) * (x + 4) - Sin(x); writeln('Значение y =(x+4)^3 -Sin(x) в точке x = ', x:3, ': ', y:0:5); x := x + 5; 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.
// 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.
begin
Range(-50,50,5).Tabulate(x->(x+4)*sqr(x+4)-sin(x)).Print(NewLine)
end.
Результат:
(-50,-97336.2623748537)
(-45,-68920.1490964755)
(-40,-46655.2548868395)
(-35,-29791.4281826695)
(-30,-17576.9880316241)
(-25,-9261.1323517501)
(-20,-4095.08705474927)
(-15,-1330.34971215984)
(-10,-216.544021110889)
(-5,-1.95892427466314)
(0,64)
(5,729.958924274663)
(10,2744.54402111089)
(15,6858.34971215984)
(20,13823.0870547493)
(25,24389.1323517501)
(30,39304.9880316241)
(35,59319.4281826695)
(40,85183.2548868395)
(45,117648.149096475)
(50,157464.262374854)