Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- welcome = "Введите a, b, c: "
- print(welcome)
- a = float(input("a = "))
- b = float(input("b = "))
- c = float(input("c = "))
- d = (b * b) - 4 * a * c
- print('D = ', d)
- if d > 0:
- import math
- x1 = (-b + math.sqrt(d)) / (2 * a)
- x2 = (-b - math.sqrt(d)) / (2 * a)
- print("x1 = ", x1, "x2 = ", x2)
- elif d == 0:
- x = -b / (2 * a)
- print("x = ", x)
- else:
- print("Корней нет")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement