Ŀ

գҪıйص䡣
һrepeat (0<repeat<10)repeat㣺
a,b,cһԪηa*x*xb*xc0ĸ2λС
ʹ䣺
printf("Ϊ㣬!\n");
printf("abΪ0cΪ0̲\n");
printf("x = %0.2f\n", -c/b);
printf("x1 = %0.2f\n", (-b+sqrt(d))/(2*a));
printf("x2 = %0.2f\n", (-b-sqrt(d))/(2*a));
printf("x1 = %0.2f+%0.2fi\n", -b/(2*a), sqrt(-d)/(2*a));
printf("x2 = %0.2f-%0.2fi\n", -b/(2*a), sqrt(-d)/(2*a));
ʾΪ˵
룺
5               (repeat=5)
0 0 0           (a=0,b=0,c=0)
0 0 1           (a=0,b=0,c=1)
0 2 4           (a=0,b=2,c=4)
2.1 8.9 3.5     (a=2.1,b=8.9,c=3.5)
1 2 3           (a=1,b=2,c=3)

Ϊ㣬!
abΪ0cΪ0̲
x = -2.00
x1 = -0.44
x2 = -3.80
x1 = -1.00+1.41i
x2 = -1.00-1.41i



#include <stdio.h>
#include <math.h>
int main(void)
{
    int repeat, ri;
    double a, b, c, d;

    scanf("%d", &repeat);
    for(ri = 1; ri <= repeat; ri++){
        scanf("%lf%lf%lf", &a, &b, &c);
/*---------*/
    }     
} 