daily pastebin goal
58%
SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. uses
  2.   SysUtils;
  3.  
  4. var
  5.     a,b,h,y,s,z,x,a1,a2,sn:Real;
  6.     n,k,i:Integer;
  7.  
  8. begin
  9.   Writeln('x ot...do...s shagom...');
  10.   Readln(a,b,h);
  11.   x:=a;
  12.   while x<=b do
  13.    begin
  14.      y:=0;
  15.      s:=1;
  16.      n:=1;
  17.      k:=2;
  18.      z:=x;
  19.      while abs(s)>=0.0001 do
  20.      begin
  21.        i:=2;
  22.        sn:=z;
  23.        a2:=1;
  24.        a1:=z;
  25.      while Abs(a2)>=0.0001 do
  26.       begin
  27.         a2:=a1*(-z)*z/(i*(i+1));
  28.         sn:=sn+a2;
  29.         i:=i+2;
  30.         a1:=a2;
  31.       end;
  32.        s:=n*sn/k;
  33.        y:=y+s;
  34.        inc(n);
  35.        k:=k*2;
  36.        z:=x*n;
  37.      end;
  38.      Writeln('x = ',x:1:2,' y = ',y:5:8);
  39.      x:=x+h;
  40.    end;
  41.    readln
  42. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top