Косте

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const M=10;
var
x: real;
i: byte;
function fact(n: byte): integer;
var i: byte;
begin
fact:=1; i:=1;
while (i<=n) do
begin
fact:=fact*i;
i:=i+1;
end;
end;
function tailor(x: real; n: byte): real;
var
i: byte;
begin
tailor:=1;
for i:=1 to n do
tailor:=tailor+((2*i+1)/fact(i))*exp(2*i*ln(x));
end;
BEGIN
x:=0.1;
for i:=1 to M do
begin
writeln(x:8:3, ((1+2*(x*x))*exp(x*x*ln(2.7))):10:3, tailor(x, i):10:3,
(((1+2*(x*x))*exp(x*x*ln(2.7)))-tailor(x, i)):10:3);
x:=x+0.1;
end;
END.