Forezz

Решалка КУ

Nov 15th, 2019
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. print ("Впишите значение a")
  2. a = input()
  3. if a == "":
  4.     a = 1
  5. a = int(a)
  6. print ("Впишите значение b")
  7. b = int(input())
  8. print ("Впишите значение c")
  9. c = int(input())
  10. d = b ** 2  - (4 * a * c)
  11. if d >=0:
  12.     x1 = (-b + d ** 0.5) / 2 * a
  13.     x2 = (-b - d ** 0.5) / 2 * a
  14.     print("Корень 1 равен", x1 )
  15.     print("Корень 2 равен", x2 )
  16. else:
  17.     print ("Корней нет")
  18. print(d)
Add Comment
Please, Sign In to add comment