Write a programElementary20 XPExercise 13/16
Quadratic equation
Task
The program reads the coefficients a, b, c of the quadratic equation ax² + bx + c = 0 (each on its own line, a is not 0) and prints its real roots:
- with two roots, both on one line from the smaller to the larger,
- with one (double) root, that root,
- with no real solution,
nema riesenie(no solution).
Two decimal places of precision are enough.
Examples
Input
1 -5 6
Expected output
2 3
After you submit, 5 hidden tests will also check your solution: a double root, a negative discriminant, a = 2, irrational roots, a negative a.
Python starts the first time you run code.
Ctrl+Enter runs the program. Tab indents. Press Esc, then Tab, to leave the editor.
Input (stdin)
Each line = one call to input().
Output
Hints
Try it yourself first. Each hint reveals a little more - and lowers the reward a little.
Signed out, hints are free - but no XP is awarded either.
Solution
The solution unlocks after the last hint.