Var e,a,s:real; a1,f,f1,f2,a3,z:integer;
begin
e:=0.001;
s:=1; a:=1; z:=-1;
a1:=0; f1:=1; f2:=1; a3:=1;
while abs(a)>e do
begin
a1:=a1+2;
f:=f1+f2; f1:=f2; f2:=f;
a3:=a3*3;
z:=-z;
a:=z*a1/(f*a3);
s:=s+a;
end;
writeln('s = ',s:5:3);
end.
Результат:
s = 1.220