Вводятся 5 чисел: a, b, c, d и e.
Найдите все целые решения уравнения ( ax3 + bx2 + cx + d ) / ( x - e ) = 0 на отрезке [0,1000] и выведите их количество.
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
s = 0
for i in range (0, 1000):
if (a*i*i*i+ b*i*i+ c*i+ d)/(i-e) == 0:
s = s+1
print(s)
На выходе выдаёт ошибку: division by zero
Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Copyright © 2024 SCHOLAR.TIPS - All rights reserved.