25. Nature of Quadratic Roots
Core1000 ms256 MBSolved by 0%
For a quadratic equation ax² + bx + c = 0, the discriminant is
b² − 4ac. Its sign tells you what kind of roots the equation has.
Read a, b and c on one line and print:
Real and distinctwhen the discriminant is positiveReal and equalwhen it is exactly zeroComplexwhen it is negative
Constraints - `-10000 ≤ a, b, c ≤ 10000` - `a` is never zero.
Input
A single line containing three integers a, b and c, separated by spaces.
Output
Print exactly one of Real and distinct, Real and equal or Complex.
Input1 -3 2
OutputReal and distinct
Notehas a positive discriminant of 1
Input1 2 1
OutputReal and equal
Notehas a discriminant of exactly zero
Hints
Four rungs, in order. The last two open once you have submitted an attempt. A wrong one counts.
Hint 1Where to start
Hint 2The approachOpen hint 1 first. This one carries on from it.
Hint 3PseudocodeOpen hint 2 first. This one carries on from it.
Hint 4Full solutionOpen hint 3 first. This one carries on from it.