THE CHALLENGEQUADRATIC_EQUATION — Solve ax² + bx + c = 0.
Read three real numbers a, b and c (one per line).
- if a = 0, solve the linear equation bx + c = 0
- otherwise compute the discriminant D = b² - 4ac:
- D > 0: print "x1 = ..." then "x2 = ..." (two decimal places, in increasing order)
- D = 0: print "x = ..."
- D < 0: print "Pas de solution reelle"
Input:
1
-3
2
Output:
x1 = 1.00
x2 = 2.00
Discriminant challenge: zero loops, no math.sqrt (use the power 0.5) and at most 5 conditions.
Checks (verified automatically before your code runs):
- No loops at all: no for, no while, no comprehensions.
- Do not use sqrt().
- At least 1 use of the ** operator.
- At most 5 if/elif branches.
Hint: d ** 0.5 is the square root of d. sorted() puts the two roots in order.