Николай
Профи
(606)
11 лет назад
function f(x:real):real;
begin {контрольная функция}
f:=(x*x/4+x/2+1)*exp(x/2);
end;
function factorial(n:integer):real;
var i: integer;
fact: real;
begin
if n=0 then result:=1
else result:=n*factorial(n-1);
end;
function summ(x,h:real):real;
var
s: real;
begin
s:=1; {функция суммы}
n:=1;
while (abs(s-f(x))>=eps) do begin
s:= s + ((n*n+1)/factorial(n) )* exp(ln(x/2)*n);
n:=n+1;
end;
summs:= s;
end;
procedure output;
h:=strtofloat(edit1.text);
xn=strtofloat(edit2.text);
xk:=strtofloat(edit3.text);
h:=strtofloat(edit4.text);
x:=xn;
while x<=(x2+xs) do
begin
memo1.Lines.Add(floattostr(sUMMS(X,h)));
memo2.Lines.Add(floattostr(f(x))); {табулирование}
memo3.Lines.Add(floattostr(x));
x:=x+h;
end;