eolymp
bolt
Try our new interface for solving problems
Problems

Quadratic equation

published at 6/5/18, 6:29:18 pm

В кого не проходить 6-8, там треба між one root і числом пробіл ставити -_-

published at 3/6/19, 10:41:04 pm

bmidik25 не допомагає))

published at 5/19/19, 2:39:23 pm

Тести 10, 14 порядок виведення коренів min(x1,x2) max(x1,x2)

published at 8/28/20, 5:47:24 pm

мне помогла дорешать отдельная проверка,какой из корней меньший

published at 3/8/24, 4:02:23 pm

a, b, c = map(int, input().split())

if a == 0 or abs(a) > 100 or abs(b) > 100 or abs(c) > 100: print() else: d = b * 2 - 4 * a * c if d < 0: print("No roots") else: x1 = (-b + d * 0.5) / (2 * a) x2 = (-b - d ** 0.5) / (2 * a) if d > 0: x1 = int(x1) x2 = int(x2) if x1 > x2: temp = x1 x1 = x2 x2 = temp print("Two roots:", x1, x2) elif d == 0: x1 = int(x1) print("One root:", x1)