Вычислить ряд s=1!/2+2!/(3+4)+3!/(4+5+6)+4!/(5+6+7+9)+5!/(6+7+8+10+13) и т.д.Количество слагаемых зависит от введенного N — Pascal(Паскаль)

uses crt;
function Fib(n:integer):integer;{вычисление чисел Фибоначчи}
begin
if n<2 then Fib:=1
else Fib:=Fib(n-1)+Fib(n-2);
end;
var n,i,j,fb:integer;
    s,fc:real;
begin
clrscr;
write('n=');
readln(n);
s:=0;
fc:=1;
for i:=1 to n do
 begin
  fc:=fc*i;{считаем числитель}
  fb:=0;
  for j:=1 to i do
  fb:=fb+(i+Fib(j));{знаменатель}
  s:=s+fc/fb;{сумму}
 end;
write('S=',s:0:4);
readln
end.

Leave a Comment

32 − = 24