Advertisement
adrian_fuchs

Python Bhaskara rapido

Aug 8th, 2022 (edited)
734
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. print("digite A: ")
  2. a = int(input())
  3.  
  4. print("digite B: ")
  5. b = int(input())
  6.  
  7. print("digite C: ")
  8. c = int(input())
  9.  
  10. if(a == 0):
  11.     print("A eh 0, abortando...")
  12. else:
  13.     delta = b*b-4*a*c
  14.     if(delta < 0):
  15.         print("delta negativo...")
  16.     else:
  17.         import math
  18.         x1 = (-b+math.sqrt(delta)) / (2*a)
  19.         x2 = (-b-math.sqrt(delta)) / (2*a)
  20.         print(x1)
  21.         print(x2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement