△=b*b-4*a*c;
1.△<0,无解;
2.△=0,一解;
3.△>0,二解。
注意a=0和b=c=0的情况。
#include <stdio.h>
#include <math.h>
int main()
{
    int m;
    float a,b,c;
    while(scanf("%d",&m)!=EOF)
    {
        while(m--)
        {
            scanf("%f%f%f",&a,&b,&c);
            if(b*b-4*a*c<0) printf("-1\n");
            else if(b==0&&c==0)
                printf("x=-0.00\n");
            else if(b*b-4*a*c==0&&a!=0)
                printf("x=%.2f\n",-b/(2*a));
            else if(b*b-4*a*c>0&&a!=0)
                printf("x1=%.2f,x2=%.2f\n",(-b-sqrt(b*b-4*a*c))/(2*a),(-b+sqrt(b*b-4*a*c))/(2*a));
            else if(a==0)
                printf("x=%.2f\n",-c/b);
        }
    }
    return 0;
}
(•̀ᴗ•́)و