Var a,b,h,x,g:real; n,i:integer;
begin
a:=-2; b:=2;
h:=0.25;
x:=a-h;
n:=round((b-a)/h)+1;
writeln(' № x g(x)');
for i:=1 to n do
begin
x:=x+h;
if x<=0 then g:=sqrt(1+x*x)<br> else g:=(1-2*x-x*x*x)/(1+sqrt(1+exp(-x)));
writeln(i:2,' ',x:5:2,' ',g:8:4);
end;
end.
Результат:
№ x g(x)
1 -2.00 2.2361
2 -1.75 2.0156
3 -1.50 1.8028
...
16 1.75 -3.7724
17 2.00 -5.3255