```#include<stdio.h>
#include<math.h>
int main()
{
    float a,b,c;
    float x1,x2,delta;
    while(scanf("%f%f%f",&a,&b,&c)!=EOF)
    {
       delta=b*b-4*a*c;
       x1=(-b+sqrt(delta))/(2*a);
       x2=(-b-sqrt(delta))/(2*a);
       if(a==0)
           printf("Not quadratic equation\n");
        
        else
        {
            if(delta==0)
            {
                printf("x1=x2=%0.2f\n",x1);
            }
            
            else if(delta>0)
            {
                printf("x1=%.2f;x2=%.2f\n",x2,x1);
            }
            
            else
            {
                printf("x1=%.2f-%.2fi;x2=%.2f+%.2fi\n",-b/(2*a),sqrt(-delta)/(2*a),-b/(2*a),sqrt(-delta)/(2*a));
            }
        }
    }
}


个人做法,如有错误请指正