-->
当前位置:首页 > 题库 > 正文内容

PROGRAMMING:Quadratic equation of one variable

Luz3年前 (2021-05-10)题库374
The program outputs the root of the quadratic equation $$ax ^ 2 + BX + C = 0 $$. The values of the coefficients a, B, C (real numbers) are input from the keyboard. It is required to output two different real roots of the equation, two identical real roots and the case that the equation has no real roots.
###Input format:
Three numbers
###Output format:
When there are two real roots, the big root is output first, and then the small root is output.
This equation has no real root!
The specific format is shown in the example.
###Input example:
```in
1.0 5.0 4.0
```
###Output example:
```out
x1=-1.000000
x2=-4.000000
```
###Input example:
```in
1 2 1
```
###Output example:
```out
x1=x2=-1.000000
```
###Input example:
```in
1 1 9
```
###Output example:
```out
This equation has no real root!
```







answer:If there is no answer, please comment

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。