Advertisement
VladimirKostovsky

Алгол-68 (наши дни)

Jun 2nd, 2022
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.79 KB | None | 0 0
  1. {Задача 2}
  2. Var
  3. x, k ,s, EPS: real;
  4.  
  5. Begin
  6.     Write('x = '); read(x);
  7.     Write('EPS = '); read(EPS);
  8.     if EPS < 0 then begin
  9.         Write('Неверно задано е');
  10.         halt;
  11.     end;
  12.     k := 1; s := 0;
  13.     while (x/(power(k,3) * sqrt(x) + 3)) > EPS do begin
  14.         s := s + (x/(power(k,3) * sqrt(x) + 3));
  15.         k := k + 1;
  16.     end;
  17.     WriteLn(s : 0 : 4);
  18. End.
  19.  
  20. {Задача 3}
  21. Var
  22. x, i, EPS: real;
  23. a, a1: real;
  24. Begin
  25.     Write('x = '); read(x);
  26.     Write('EPS = '); read(EPS);
  27.     if EPS < 0 then begin
  28.         Write('Неверно задано е');
  29.         halt;
  30.     end;
  31.     a := x;
  32.     a1 := 0;
  33.     i := 2;
  34.     while abs(a - a1) > EPS do begin
  35.     a1 := a;
  36.         a := 2 + (1/(power(e, i)))* power(cos(a1 - 2*x),2);
  37.         i += 1;
  38.     end;
  39.     WriteLn(a : 0 : 4);
  40. End.
  41.  
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement