last lab
This commit is contained in:
29
labPython/lab2/TheTwo16.py
Executable file
29
labPython/lab2/TheTwo16.py
Executable file
@@ -0,0 +1,29 @@
|
||||
# print("Введите число N")
|
||||
# N = int(input())
|
||||
#
|
||||
# def fac(x: int): # факториал числа
|
||||
# return _fac (x*2, x)
|
||||
#
|
||||
# def _fac(x: int, y: int):
|
||||
# if x > y:
|
||||
# return (y * _fac(x, y+1))
|
||||
# else:
|
||||
# return y
|
||||
#
|
||||
# x = 0
|
||||
# if N <= 12:
|
||||
# for i in range(1, N+1):
|
||||
# step = i**i
|
||||
# factorial = fac(i)
|
||||
# x += step / factorial
|
||||
# print(x)
|
||||
|
||||
N = int(input())
|
||||
s = 0
|
||||
for i in range(1, N + 1):
|
||||
p = 1
|
||||
for j in range(i, 2 * i + 1):
|
||||
p *= j
|
||||
s += i**2 / p
|
||||
|
||||
print(s)
|
||||
Reference in New Issue
Block a user