Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. welcome = "Введите a, b, c: "
  2. print(welcome)
  3. a = float(input("a = "))
  4. b = float(input("b = "))
  5. c = float(input("c = "))
  6. d = (b * b) - 4 * a * c
  7. print('D = ', d)
  8. if d > 0:
  9. import math
  10. x1 = (-b + math.sqrt(d)) / (2 * a)
  11. x2 = (-b - math.sqrt(d)) / (2 * a)
  12. print("x1 = ", x1, "x2 = ", x2)
  13. elif d == 0:
  14. x = -b / (2 * a)
  15. print("x = ", x)
  16. else:
  17. print("Корней нет")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement