darya_leushkina

Задание 9

Nov 19th, 2020 (edited)
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. e = float(input())
  2. i = 1
  3. a = float(-1)
  4. s = 0
  5. f = 1
  6. while abs(round(a / f, 30)) > e:
  7.     s += round(a / f, 30)
  8.     a *= -1
  9.     i += 1
  10.     f = 1
  11.     for j in range(1, 2 * i):
  12.         f *= j
  13. print(s)
  14.  
Add Comment
Please, Sign In to add comment