Ответ:
1)
from math import factorial
print(factorial(int(input())))
2)
f1 = f2 = 1
n = int(input())
print(f1, f2, end=' ')
for i in range(2, n):
f1, f2 = f2, f1 + f2
print(f2, end=' ')
3)
j = int(input())
summ = 0
for n in range(2, j + 1):
if n > 1:
if (n % i) == 0:
break
else:
summ += n
print(summ)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
Ответ:
1)
from math import factorial
print(factorial(int(input())))
2)
f1 = f2 = 1
n = int(input())
print(f1, f2, end=' ')
for i in range(2, n):
f1, f2 = f2, f1 + f2
print(f2, end=' ')
3)
j = int(input())
summ = 0
for n in range(2, j + 1):
if n > 1:
for i in range(2, n):
if (n % i) == 0:
break
else:
summ += n
print(summ)