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