D1maz

С6.3-0-29

Oct 17th, 2018
451
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.84 KB | None | 0 0
  1. var f1,f2,fn:integer;//С6.3-0-29
  2.     fact,fact1:integer;
  3.     factn,factn1:integer;
  4.     sum,sum1:real;
  5.     eps:real;
  6.  
  7. begin
  8.   writeln('введите eps');
  9.   readln(eps);
  10.   factn:=1;
  11.   factn1:=5;
  12.   fact:=1;
  13.   fact1:=5*4*3*2*1;
  14.   f1:=1;
  15.   f2:=1;
  16.   sum1:=f1/(fact*sqr(fact1));
  17.   fn:=f1+f2;
  18.   f2:=f1;
  19.   f1:=fn;
  20.   fn:=f1+f2;
  21.   f2:=f1;
  22.   f1:=fn;
  23.   factn:=factn+2;
  24.   factn1:=factn1+2;
  25.   fact:=fact*(factn-1)*factn;
  26.   fact1:=fact1*(factn1-1)*factn1;
  27.   while abs(sum1)>eps do//С6.3-0-29
  28.     begin
  29.       sum:=sum+sum1;
  30.       writeln('sum = ',sum,'; sum1 = ',sum1);
  31.       fn:=f1+f2;
  32.       f2:=f1;
  33.       f1:=fn;
  34.       fn:=f1+f2;
  35.       f2:=f1;
  36.       f1:=fn;
  37.       factn:=factn+2;
  38.       factn1:=factn1+2;
  39.       fact:=fact*(factn-1)*factn;
  40.       fact1:=fact1*(factn1-1)*factn1;
  41.       sum1:=f1/(fact*sqr(fact1));
  42.     end;
  43. end.
Add Comment
Please, Sign In to add comment