Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- a = float(input("Podaj liczbę a: "))
- b = float(input("Podaj liczbę b: "))
- c = float(input("Podaj liczbę c: "))
- d = -b
- print (d)
- print("Równanie: ", a, "x^2 + ", b, "x + ", c)
- delta = math.pow(b,2) - 4*a*c
- if delta > 0:
- x1 = (-b - math.sqrt(delta))/(2*a)
- x2 = (-b + math.sqrt(delta))/(2*a)
- print("Delta wynosi: ", delta)
- print("Pierwiastek pierwszy wynosi: ", x1)
- print("Pierwiastek drugi wynosi: ", x2)
- elif delta == 0:
- x0 = -b/(4*a)
- else:
- print("Brak pierwiastków")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement