Kvadrat tenglama yechish algoritimini tuzish


Download 40.59 Kb.
Sana13.12.2022
Hajmi40.59 Kb.
#1001052
Bog'liq
Tarmoqlanuvchi A


Kvadrat tenglama yechish algoritimini tuzish.
, ,

Python tilida dasturi:
a, b, c = map(int, input().split(' '))
D = b**2-4*a*c
if D > 0:
x1 = (-b+sqrt(D))/(2*a)
x2 = (-b-sqrt(D))/(2*a)
print(x1,x2)
elif D == 0:
x1 = -b/(2*a)
print(x1)
else:
print('yechim ega emas')
Download 40.59 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling