InnaSibirova

Антон Турчаков - Урок 1. Задание 6.

Oct 30th, 2018
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. import math  
  2. a = float(input())
  3. b = float(input())
  4. c = float(input())
  5. d = b ** 2 - (4 * a * c)
  6. if d > 0:
  7.     x1 = (-b + sqrt(d)) / (a * 2)
  8.     x2 = (-b - sqrt(d)) / (a * 2)
  9.     print("x1 = ", x1)
  10.     print("x2 = ", x2)
  11. elif d < 0:
  12.     print("Нет решений")
  13. else:
  14.     x = -b / (2 * a)
  15.     print('x = ', x)
Add Comment
Please, Sign In to add comment