while True:
a = int(input("ax^2+bx+c=0 / a: "))
b = int(input("ax^2+bx+c=0 / b: "))
c = int(input("ax^2+bx+c=0 / c: "))
d = b ** 2 - 4*a*c
if d > 0:
x1 = (-b+math.sqrt(d))/2*a
x2 = (-b-math.sqrt(d))/2*a
print('Корней: 2. \n x1 = 'x1)
print('Корней: 2. \n x2 = 'x2)
if d == 0:
x1 = -b/2*a
print('Корней: 1 \n x + 'x1)
if d < 0:
print("Корней: 0")
import math
while True:
a = int(input("ax^2+bx+c=0 / a: "))
b = int(input("ax^2+bx+c=0 / b: "))
c = int(input("ax^2+bx+c=0 / c: "))
d = b ** 2 - 4 * a * c
if d > 0:
x1 = (-b + math.sqrt(d)) / (2 * a)
x2 = (-b - math.sqrt(d)) / (2 * a)
print(f'Корней: 2. \n x1 = {x1}')
print(f'Корней: 2. \n x2 = {x2}')
elif d == 0:
x1 = -b / (2 * a)
print(f'Корень: 1. \n x1 = {x1}')
else:
print("Корней: 0")