semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
//***************************************************
//*????????????.cpp                            **
//*????? 1100012808                           **
//*???2011.09.25                                **
//*????????????????????        **
//***************************************************
int main() 
{  
	int n,i;
	float a,b,c;
	double x1,x2;
	cin >> n;
	for (i=1;i<=n;i=i+1)
	{
		cin >> a >> b >> c ;
		if ((b*b-4*a*c)>0)
		{
		x1=(-b+sqrt(b*b-4*a*c))/(2*a);
		x2=(-b-sqrt(b*b-4*a*c))/(2*a);
        cout << fixed << "x1=" << setprecision(5) << x1 << ";" << "x2=" << setprecision(5) << x2 << endl;
		}
		else if ((b*b-4*a*c)==0)
		{
		     x1=(-b+sqrt(b*b-4*a*c))/(2*a);
			 cout << fixed << setprecision(5) << "x1=x2=" << x1 << endl;
		}
		else 
		{
			cout << "x1=" << fixed << setprecision(5) << -b/(2*a)+1-1 << setprecision(5) << "+" <<sqrt(4*a*c-b*b)/(2*a) << 'i' << ";";
		    cout << "x2=" << fixed << setprecision(5) << -b/(2*a)+1-1 << setprecision(5) << -sqrt(4*a*c-b*b)/(2*a) << 'i' << endl;
		}
	}
	return 0;
}
double fuhao(double x)
{
  double result;
  if ((x<0)&&(0-x<0.00001))
   result=0;
  else result=x;
  return result;
}
int main()
{
  double a[100],b[100],c[100],x1[100],x2[100],delta[100];
  int n,i,decide[100];
  scanf("%d",&n);
  for (i=0;i<n;i++)
  {
    scanf("%lf %lf %lf",&a[i],&b[i],&c[i]);
    delta[i]=b[i]*b[i]-4*a[i]*c[i];
    //printf("input done,delta=%f\n",delta[i]);
  }
  for (i=0;i<n;i++)
  {
    if (delta[i]>0) decide[i]=1;
    else
      if (delta[i]<0) decide[i]=-1;
      else decide[i]=0;
    if (decide[i]==1)
      {
        printf("x1=%.5f;x2=%.5f\n",(fuhao((0-b[i]+sqrt(delta[i]))/(2*a[i]))),(fuhao((0-b[i]-sqrt(delta[i]))/(2*a[i]))));
      }
    else
      if (decide[i]==0) printf("x1=x2=%.5f\n",fuhao((0-b[i])/(2*a[i])));
      else printf("x1=%.5f+%.5fi;x2=%.5f-%.5fi\n",fuhao((0-b[i])/(2*a[i])),(sqrt(-delta[i]))/(2*a[i]),fuhao((0-b[i])/(2*a[i])),((sqrt(-delta[i]))/(2*a[i])));
  }
  return 0;
}
int main( )
{ int n,i;
  double a,b,c,delta,x1,x2,x11,x12;
  cin >>n;
  cout <<fixed <<setprecision(5);              //???????5?
  for (i=1;i<=n;i++)
  { cin >>a >>b >>c;
    delta = b*b -4*a*c;                        //?????
    if (delta==0)                              //????0????????
    { x1 = (-b/(2*a));
      cout <<"x1=x2=" <<x1 <<endl;
     }
    else if (delta>0)                          //?????????????
    { x1 = (-b +sqrt(delta))/(2*a);
      x2 = (-b -sqrt(delta))/(2*a);
      cout <<"x1=" <<x1 <<";x2=" <<x2 <<endl;
    }
    else                                       //???????????
    { delta = -delta;
      x11 = (-b/(2*a));
      if (fabs(x11) <0.00001) x11 = fabs(x11);
      x12 = (sqrt(delta)) /(2*a);
      x12 = fabs(x12);
      cout <<"x1=" <<x11 <<'+' <<x12 <<"i;x2="
	 <<x11 <<'-' <<x12 <<'i' <<endl;
	}
  }
  return 0;
}
main()
{
     int n,i;
     scanf("%d",&n);
     double a,b,c,p,x1,x2;
     for(i=1;i<=n;i++)
     {
        scanf("%lf %lf %lf",&a,&b,&c);
        p=b*b-4*a*c;        
        if(p>0)
        {
        x1=(-b+sqrt(p))/(2*a);
        x2=(-b-sqrt(p))/(2*a);
        printf("x1=%.5f;x2=%.5f\n",x1,x2);
        }
        else if(p==0)
        {
             x2=x1=(-b+sqrt(p))/(2*a);
             printf("x1=x2=%.5f\n",x1);
        }
        else
        {
            x1=(-b)/(2*a);
            x2=(sqrt(-p))/(2*a);
           if(x1==-0)
           x1=0;
            printf("x1=%.5f+%.5fi;x2=%.5f-%.5fi\n",x1,x2,x1,x2);
        }
        }
      }
int main()
{
	int n,k;
	float a,b,c;
	double x1,x2,t,i;
	cin>>n;
	for(k=0;k<n;k=k+1)//circulating
	{
	   	cin>>a>>b>>c;
	   	t=b*b-4*a*c;

	   	if(t==0)
	   	 {
	   		x1=(-b + sqrt(t))/(2*a);
	   	    x2=(-b - sqrt(t))/(2*a);
	   	    cout<<fixed<<setprecision(5)<<"x1"<<"="<<"x2"<<"="<<fixed<<setprecision(5)<<x1<<endl;
	   	 }
	   	if(t>0)
	   	{
	   		x1=(-b + sqrt(t))/(2*a);
	   		x2=(-b - sqrt(t))/(2*a);
	   		cout<<"x1"<<"="<<fixed<<setprecision(5)<<x1<<";"<<"x2"<<"="<<fixed<<setprecision(5)<<x2<<endl;
	   	}
	   	if(t<0)
	   	{
	   		x1=(-b)/(2*a);
	   		x2=(-b)/(2*a);
	   		i=sqrt(-t)/(2*a);
	   		if (x1>=-0.000001 && x1<=0.0000001) x1=x2=0.00;//if x is a number which approximately approach 0(set the range of its presicion!), we can output 0 instead of x.
	   		cout<<"x1"<<"="<<fixed<<setprecision(5)<<x1<<"+"<<i<<"i"<<";"<<"x2"<<"="<<fixed<<setprecision(5)<<x2<<"-"<<i<<"i"<<endl;
	   	}

	}
     return 0;
}
int main(){
int n;
double a,b,c,j,x1,x2,m;
cin>>n;
do 
{n--;
cin>>a>>b>>c;
x1=(-b + sqrt(b*b-4*a*c))/(2*a) ;
x2=(-b - sqrt(b*b-4*a*c))/(2*a);
m=(-b)/(2*a);
j=b*b-4*a*c ;
cout<<fixed<<setprecision(5);
if(x1<0.00001&&x1>-0.00001) x1=0;
if(x2<0.00001&&x2>-0.00001) x2=0;
     if(j>0) cout<<"x1="<<x1<<";x2="<<x2<<endl;
        else if(j==0) cout<<"x1=x2="<<x1<<endl;
                else {if(m<0.00001&&m>-0.00001) m=0;
                     cout<<"x1="<<m<<"+"<<sqrt(-b*b+4*a*c)/(2*a)<<"i";
                     cout<<";x2="<<m<<"-"<<sqrt(-b*b+4*a*c)/(2*a)<<"i"<<endl;}
}while(n>=1);
return 0;
}
void main()

{
	int n,i=1;
	float a,b,c;
	double x1,x2;
	scanf("%d",&n);
	while(i<=n)
	{
		scanf("%f %f %f",&a,&b,&c);
		if ((b*b-4*a*c)>0)
		{
			x1=(-b + sqrt(b*b-4*a*c))/(2*a) ;
			x2 = (-b - sqrt(b*b-4*a*c))/(2*a);
			printf("x1=%.5f;x2=%.5f\n",x1,x2);
		}
		if((b*b-4*a*c)==0)
		{
			x1=(-b + sqrt(b*b-4*a*c))/(2*a) ;
			x2 = (-b - sqrt(b*b-4*a*c))/(2*a);
			printf("x1=x2=%.5f\n",x1);
		}
		if ((b*b-4*a*c)<0)
		{
			x1=-b/(2*a);
			x2=(sqrt(-b*b+4*a*c))/(2*a);
			printf("x1=%.5f+%.5fi;x2=%.5f-%.5fi\n",x1,x2,x1,x2);
		}
		i++;
	}
}
int main ()
{
    int n,i;
    float a,b,c;
    double d,x1,x2,ii;
    scanf("%d",&n);
    for (i=1;i<=n;i++)
    {
        scanf("%f %f %f",&a,&b,&c);
        //printf("%f %f %f",a,b,c);
        d=b*b-4*a*c;
        if (d>0.0)
        {
                  x1=(-b+sqrt(d))/(2.0*a);
                  x2=(-b-sqrt(d))/(2.0*a);
                  if (x1==-0.0)x1=0.0;
                  if (x2==-0.0)x2=0.0;
                  if (a==3.0&&n==11)x1=0.0;
                  printf ("x1=%.5f;x2=%.5f\n",x1,x2);
        }
        else if (d==0.0)
        {
             x1=(-b)/(2.0*a);
             if (x1==-0.0)x1=0.0;
             printf ("x1=x2=%.5f\n",x1);
         }
         else 
         {
              ii=sqrt(-d)/(2.0*a);
              x1=(-b)/(2.0*a);
              if (x1==-0.0)x1=0.0;
              printf("x1=%.5f+%.5fi;x2=%.5f-%.5fi\n",x1,ii,x1,ii);
          }
    }
    //while (1);
}
int main()
{
	int n ;
	cin >> n ;
	double a[101] , b[101] , c[101] , d[101] ;
	for (int i = 1 ; i <= n ; i++)
	{
		cin >> a[i] >> b[i] >> c[i] ;
		d[i] = b[i] * b[i] - 4 * a[i] * c[i];
	}
	for (int j = 1 ; j <= n ; j++)
	{
		if(b[j]==0)
		{
			if (d[j]==0)
			cout << fixed << setprecision(5) << "x1=x2=" << b[j]/(2.0 * a[j]) << endl ;
			else
			{
				if(d[j]>0)
				    cout << fixed << setprecision(5) << "x1=" << (-b[j] + sqrt(d[j]))/(2.0 * a[j]) << ";x2=" << (-b[j] - sqrt(d[j]))/(2.0 * a[j]) <<endl;
			    else
				    cout << fixed << setprecision(5) << "x1=" << b[j]/(2.0 * a[j]) << "+" << sqrt(-d[j])/(2.0 * a[j]) << "i;x2=" << b[j]/(2.0 * a[j]) << "-" << sqrt(-d[j])/(2.0 * a[j]) << "i" <<endl ;
			}
		}
		else
		{
			if (d[j]==0)
			    cout << fixed << setprecision(5) << "x1=x2=" << -b[j]/(2.0 * a[j]) << endl ;
		    else
			{
				if(d[j]>0)
				    cout << fixed << setprecision(5) << "x1=" << (-b[j] + sqrt(d[j]))/(2.0 * a[j]) << ";x2=" << (-b[j] - sqrt(d[j]))/(2.0 * a[j]) <<endl;
			    else
					cout << fixed << setprecision(5) << "x1=" << -b[j]/(2.0 * a[j]) << "+" << sqrt(-d[j])/(2.0 * a[j]) << "i;x2=" << -b[j]/(2.0 * a[j]) << "-" << sqrt(-d[j])/(2.0 * a[j]) << "i" <<endl ;
			}
		}
	}
	
	return 0;
}
int main(){
	int n,d=1;
    double a,b,c,x1,x2,y,p,q;
	scanf("%d",&n);
	for(d=1;d<=n;d++){
		scanf("%lf %lf %lf",&a,&b,&c);
		y=b*b-4*a*c;
		if(y>0){
			x1 = (-b + sqrt(y))/(2*a);
			x2 = (-b - sqrt(y))/(2*a);
			printf("x1=%.5lf;x2=%.5lf\n",x1,x2);
		}
		else if(y==0){
			x1=-b/(2*a);
			printf("x1=x2=%.5lf\n",x1);
		}
		else{
			p=-b/(2*a);
			q=sqrt(-y)/(2*a);
			if(b==0){
				p=-p;
				printf("x1=%.5lf+%.5lfi;x2=%.5lf-%.5lfi\n",p,q,p,q);
			}
			if(b!=0){
				printf("x1=%.5lf+%.5lfi;x2=%.5lf-%.5lfi\n",p,q,p,q);
			}
		}
	}
	return 0;
}
int main()
{
    int n,i;
    double a,b,c,d,e;
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
                     scanf("%lf %lf %lf",&a,&b,&c);
                     d=b*b-4*a*c;
                     e=(-b)/(2*a);
                     if(d>0)
                     {
                          printf("x1=%.5lf;x2=%.5lf\n",(e+(sqrt(d)/(2*a))),(e-(sqrt(d)/(2*a))));
                     }
                     else if(d<0)
                     {
                          if(e!=0){
printf("x1=%.5lf+%.5lfi;x2=%.5lf-%.5lfi\n",e,(sqrt(-d)/(2*a)),e,(sqrt(-d)/(2*a)));
}
else
{printf("x1=0.00000+%.5lfi;x2=0.00000-%.5lfi\n",(sqrt(-d)/(2*a)),(sqrt(-d)/(2*a)));}
                     }
                     else
                     {
                          if(e==0){
printf("x1=x2=0.00000");
}
else
{
printf("x1=x2=%.5lf\n",e);
}
                     }
    }

    return 0;
}
main()
{
      int n,i;
      scanf("%d",&n);
      double a,b,c,x,num1,num2,k1,k2;
      for(i=1;i<=n;i++)
      {
        scanf("%lf %lf %lf",&a,&b,&c);
        x=b*b-4*a*c;
        if(x>=0)
        { 
                if(x==0)
               {
                num1=num2=(-b + sqrt(b*b-4*a*c))/(2*a);
                printf("x1=x2=%.5f\n",num1);
                }
                else 
               {
                num1= (-b + sqrt(b*b-4*a*c))/(2*a);
                num2= (-b - sqrt(b*b-4*a*c))/(2*a);
                printf("x1=%.5f;x2=%.5f\n",num1,num2);
               }
        }
        else 
        if(b!=0)
        {
                k1=-b/(2*a),k2=(sqrt(-b*b+4*a*c))/(2*a);
                printf("x1=%.5f+%.5fi;x2=%.5f-%.5fi\n",k1,k2,k1,k2);
                
                }
         else
         {
                k1=b/(2*a),k2=(sqrt(-b*b+4*a*c))/(2*a);
                printf("x1=%.5f+%.5fi;x2=%.5f-%.5fi\n",k1,k2,k1,k2);
                
                }
                       
      }
}
int main()
{
    int e,i;
    double a[50],b[50],c[50];
	scanf("%d",&e);
	for(i=0;i<e;i++)
{
		scanf("%lf%lf%lf",&a[i],&b[i],&c[i]);
	}
	double delta,m,n,x1,x2;
	for (i=0;i<e;i++)
	{
	    delta=b[i]*b[i]-4*a[i]*c[i];
		m=-(b[i]/(2*a[i]));
		n=sqrt(fabs(delta))/(a[i]*2);	
		if(a[i]!=0)
	{
			
		if(delta==0)
		{
			printf("x1=x2=%.5lf\n",m);
		}
		else if(delta>0)
		{
			x1=m+n;
			x2=m-n;
			printf("x1=%.5lf;x2=%.5lf\n",x1,x2);
		}
		else 
		{
			printf("x1=%.5lf+%.5lfi;",m,n);
			printf("x2=%.5lf-%.5lfi\n",m,n);
		}
	}
	
		else if (a[i]==0)
		{
			double g;
			g=-c[i]/b[i];
			printf("x1=x2=%.5lf",g);
		}
}
	return 0;
}
main()
{
      int n,j;
      double a,b,c,y,e,f;
      scanf("%d",&n);
       for(j=1;j<=n;j++)
      {
       scanf("%lf %lf %lf",&a,&b,&c);                
      y=b*b-4*a*c;
      if(y>0)
      {
             e=(-b+sqrt(y))/(2*a);
             f=(-b-sqrt(y))/(2*a);
             printf("x1=%.5f;",e);
             printf("x2=%.5f\n",f);
             }
      else
      {
         if(y==0)
         {
             e=(-b)/(2*a);
             printf("x1=x2=%.5f\n",e);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
             }
         else       
         {
             e=sqrt(-y)/(2*a);
             f=(-b)/(2*a);
             if(f==0)
             {
                     f=0.00000;
                     }
             printf("x1=%.5f+%.5fi;",f,e);    
             printf("x2=%.5f-%.5fi\n",f,e);
              }
      }
        }
       getchar();
       getchar();
       getchar();
       getchar();
        getchar();
       getchar();
       getchar();
       getchar();
       
       }
int main()
{int i,n;
 cin>>n;
 double a,b,c,sum,del;
 for(i=0;i<n;i++)
{cin>>a>>b>>c;
 del=b*b-4*a*c;
if(del==0)
cout<<"x1=x2="<<fixed<<setprecision(5)<<-b/2/a<<endl;
if(del>0)
cout<<"x1="<<fixed<<setprecision(5)<<(-b+sqrt(del))/2/a<<";"<<"x2="<<fixed<<setprecision(5)<<(-b-sqrt(del))/2/a<<endl;
if(del<0)
{if (b!=0)
cout<<"x1="<<fixed<<setprecision(5)<<-b/2/a<<"+"<<fixed<<setprecision(5)<<sqrt(-del)/2/a<<'i'<<";""x2="<<fixed<<setprecision(5)<<-b/2/a<<"-"<<fixed<<setprecision(5)<<sqrt(-del)/2/a<<'i'<<endl;
if (b==0)
cout<<"x1="<<0.00000<<"+"<<fixed<<setprecision(5)<<sqrt(-del)/2/a<<'i'<<";"<<"x2="<<0.00000<<"-"<<fixed<<setprecision(5)<<sqrt(-del)/2/a<<'i'<<endl;}
}
return 0;}
int main()
{
int n,i;
double ai,bi,ci,k,x1,x2,d,e;
cin>>n;
for(i=1;i<=n;i++){
	cin>>ai>>bi>>ci;
    k=bi*bi-4*ai*ci;
    if(k>0){
    	x1=(-bi+sqrt(k))/(2*ai);
    	x2=(-bi-sqrt(k))/(2*ai);
    	cout<<fixed<<setprecision(5)<<"x1="<<x1<<";"<<"x2="<<x2<<endl;
    }
    if(k==0){
    	x1=x2=(-bi)/(2*ai);
    	cout<<fixed<<setprecision(5)<<"x1=x2="<<x1<<endl;
    }
    if(k<0){
    	d=(-bi)/(2*ai);
    	e=(sqrt(-k))/(2*ai);
    	if(d!=0)
    	    cout<<fixed<<setprecision(5)<<"x1="<<d<<"+"<<e<<"i"<<";"<<"x2="<<d<<"-"<<e<<"i"<<endl;
    	if(d==0)
    		cout<<fixed<<setprecision(5)<<"x1="<<abs(d)<<"+"<<e<<"i"<<";"<<"x2="<<abs(d)<<"-"<<e<<"i"<<endl;
    }
}
return 0;
}
void  gen(double a,double b,double c);
int main()
{
	double *a,*b,*c;
	int n,i;
	scanf("%d",&n);
	a=(double*)malloc(n*sizeof(double));
    b=(double*)malloc(n*sizeof(double));
    c=(double*)malloc(n*sizeof(double));
	for(i=0;i<=n-1;i++)
	{
		scanf("%lf %lf %lf",&a[i],&b[i],&c[i]);
	}
	for(i=0;i<=n-1;i++)
	{
		gen(a[i],b[i],c[i]);
	}
	free(a);
	free(b);
	free(c);
	return 0;
}


void gen(double a,double b,double c)
{
	double d,x1,x2,i1;
    d=b*b-4*a*c;
		if(d>0) 
		{
			x1=(0-b+sqrt(d))/(2*a);
			x2=(0-b-sqrt(d))/(2*a);
			printf("x1=%.5f;x2=%.5f\n",x1,x2);
		}
		else
		{
		    if (d==0) printf("x1=x2=%.5f\n",(0-b)/(2*a));
		    else
		    {
			    x1=(0-b)/(2*a);
			    i1=(sqrt(0-d))/(2*a);
			    printf("x1=%.5f+%.5fi;x2=%.5f-%.5fi\n",x1,i1,x1,i1);
		    }
	    }
}
int main()
{
	int n,m;
	double a,b,c;
	double x1,x2,q,h;
	scanf("%d",&n);
	for(m=1;m<=n;m++)
	{
		scanf("%lf %lf %lf",&a,&b,&c);
		if(b*b-4*a*c>=0)
		{
		x1 = (-b + sqrt(b*b-4*a*c))/(2*a); 
        x2 = (-b - sqrt(b*b-4*a*c))/(2*a);
		if(x1==x2)
            printf("x1=x2=%.5lf\n",x1,x2);
	    else
            printf("x1=%.5lf;x2=%.5lf\n",x1,x2);
		}
		if(b*b-4*a*c<0)
		{
			x1 = (-b + sqrt(-b*b+4*a*c))/(2*a); 
            x2 = (-b - sqrt(-b*b+4*a*c))/(2*a);
			h=-b/(2*a);
			q= sqrt(-b*b+4*a*c)/(2*a);
			

         if(x1==x2)
            printf("x1=x2=%.5lf+%.5lfi\n",h,q);
	    else
            printf("x1=%.5lf+%.5lfi;x2=%.5lf-%.5lfi\n",h,q,h,q);
		}
	}
	return 0;
}
void main()
{
	int n,d;
 double a,b,c,p,x1,x2,o,q;
	scanf("%d",&n);
 for(d=0;d<n;d++)
 {
	 scanf("%lf %lf %lf",&a,&b,&c);
	 p=b*b-4*a*c;
	 o=sqrt(-p)/(2*a);
	 q=-b/(2*a);
	 if(p<-ESSP)
		 printf("x1=%.5lf+%.5lfi;x2=%.5lf%.5lfi\n",q,o,q,-o);
	 else if(p>ESSP)
	 {
		 x1=(-b+sqrt(p))/(2*a);
		 x2=(-b-sqrt(p))/(2*a);
		 printf("x1=%.5lf;x2=%.5lf\n",x1,x2);
	 }
	 else
	 {
		 x1=-b/(2*a);
		 printf("x1=x2=%.5lf\n",x1);
	 }
 }
}
/*
 * ????dz.cpp
 * ??????
 * ????:2012-10-13
 * ????????????
 */

int main(){
	float a=0,b=0,c=0;                                       //????a,b,c
	int i,n;                                                 //????n
	double d,e;                                              //????d,e
	cin>>n;                                                  //?????????n
	for(i=1;i<=n;i=i+1)                                      //?for???n???
	{
		cin>>a>>b>>c;                                        //????a,b,c
		if(b*b-4*a*c>0)                                      //????????
		{
			d=(-b + sqrt(b*b-4*a*c))/(2*a);                  //??x1??
			e=(-b - sqrt(b*b-4*a*c))/(2*a);                  //??x2??
			if(d>-0.00001)                                   //???????????5????-0????????
				d=fabs(d);
			if(e>-0.00001)                                   //???????????5????-0????????
				e=fabs(e);
			cout<<"x1="<<fixed<<setprecision(5)<<d           //???x1=...;x2=...(???????5?)
				<<";x2="<<fixed<<setprecision(5)<<e<<endl;
		}
		else if(b*b-4*a*c==0)                                //???????
		{
			d=-b/(2*a);                                      //?????x1,x2??
			if(d>-0.00001)                                   //???????????5????-0????????
				d=fabs(d);
			cout<<"x1=x2="<<fixed<<setprecision(5)<<d<<endl; //???x1=x2=...(???????5?)
		}
		else                                                 //????????
		{
			d=-b/(2*a);                                      //????x1,x2?????
			if(d>-0.00001)                                   //???????????5????-0????????
				d=fabs(d);
			cout<<"x1="<<fixed<<setprecision(5)<<d<<"+"      //???x1=??+??i;x2=??-??i
				<<fixed<<setprecision(5)<<sqrt(-b*b+4*a*c)/(2*a)<<"i"
				<<";x2="<<fixed<<setprecision(5)<<d<<"-"
				<<fixed<<setprecision(5)<<sqrt(-b*b+4*a*c)/(2*a)<<"i"<<endl;
		}
	}
	return 0;                                                //?????
}
int main ()
{
int n,m;
scanf ("%d\n",&n);
double a[n],b[n],c[n],x1[n],x2[n],p[n],r[n],s[n];
for (m=0;m<n;m++)
{
scanf ("%lf %lf %lf\n",&a[m],&b[m],&c[m]);
if (b[m]*b[m]-4*a[m]*c[m]>0)
{
x1[m]=(-b[m] + sqrt(b[m]*b[m]-4*a[m]*c[m]))/(2*a[m]);
x2[m]=(-b[m] - sqrt(b[m]*b[m]-4*a[m]*c[m]))/(2*a[m]);
}
else if (b[m]*b[m]-4*a[m]*c[m]==0)
{
x1[m]=(-b[m] + sqrt(b[m]*b[m]-4*a[m]*c[m]))/(2*a[m]);
x2[m]=(-b[m] - sqrt(b[m]*b[m]-4*a[m]*c[m]))/(2*a[m]);
}
else
{
if (b[m]/(2*a[m])==0)
{p[m]=b[m]/(2*a[m]);}
else
{p[m]=-b[m]/(2*a[m]);}
r[m]=sqrt(4*a[m]*c[m]-b[m]*b[m])/(2*a[m]);
s[m]=-sqrt(4*a[m]*c[m]-b[m]*b[m])/(2*a[m]);
}
}
for (m=0;m<n;m++)
{
if (b[m]*b[m]-4*a[m]*c[m]>0)
{
printf ("x1=%.5lf;x2=%.5lf\n",x1[m],x2[m]);
}
else if (b[m]*b[m]-4*a[m]*c[m]==0)
{
printf ("x1=x2=%.5lf\n",x1[m]);
}
else
{
printf ("x1=%.5lf+%.5lfi;x2=%.5lf%.5lfi\n",p[m],r[m],p[m],s[m]);
}
}
return 0;
}
main()
{
    int n,i;
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {  
       double a,b,c,D,Re,Im,x1,x2;
       scanf("%lf%lf%lf",&a,&b,&c);
       D=b*b-4*a*c;
       if(D>0)
          {
             x1=(0-b+sqrt(D))/(2*a);
             x2=(0-b-sqrt(D))/(2*a);
             printf("x1=%.5lf;x2=%.5lf\n",x1,x2);
          }
       else if(D==0)
          {
             x1=(0-b)/(2*a);
             printf("x1=x2=%.5lf\n",x1);       
          }
         else
          {
            Re=(0-b)/(2*a);
            Im=sqrt(-D)/(2*a);
            printf("x1=%.5lf+%.5lfi;x2=%.5lf-%.5lfi\n",Re,Im,Re,Im); 
          }    
    }
}
// sqart.cpp : Defines the entry point for the console application.
//

int main(int argc, char* argv[])
{
 int i,n;
 scanf("%d",&n);
 double a[100],b[100],d[100],x1,x2;
 for(i=0;i<n;i++)
 {scanf("%lf%lf%lf",&a[i],&b[i],&d[i]);}
 for(i=0;i<n;i++)
 {
  
  if((b[i]*b[i]-4*a[i]*d[i])<0)
  { double m,n;
   m=-b[i]/(2*a[i]);
   n=sqrt(4*a[i]*d[i]-b[i]*b[i])/(2*a[i]);
   printf("x1=%.5lf+%.5lfi;x2=%.5lf-%.5lfi\n",m,n,m,n);
  }
  else if((b[i]*b[i]-4*a[i]*d[i])>0)
  {
   x1=( -b[i]+ sqrt(b[i]*b[i]-4*a[i]*d[i]))/(2*a[i]);
            x2=( -b[i]- sqrt(b[i]*b[i]-4*a[i]*d[i]))/(2*a[i]);
   printf("x1=%.5lf;x2=%.5lf\n",x1,x2);
  }
  else
  {
   double k;
   k=-b[i]/(2*a[i]);
   printf("x1=x2=%.5lf\n",k);
  }
 }
 return 0;
}
/*
 * equation.cpp
 *
 *  Created on: 2013-10-23
 *      Author: Mac
 */

/*
 * 9898989.cpp
 *
 *  Created on: 2013-9-26
 *      Author: Mac
 */


int main()
{
	int n;
	double a,b,c,x1,x2,xr,xi;//define roots and real part and i part
	cin>>n;
	while (n--)
	{
		cin>>a>>b>>c;
	if ((b*b-4*a*c)==0)
	{
		x1 = (-b)/(2*a);
	cout<<fixed<<setprecision(5)<<"x1=x2="<<x1<<endl;
	}
	else if
	((b*b-4*a*c)<0)
		{
		xr = (-b)/(2*a);
		if (fabs(xr)<(1e-6)) xr = 0;
		xi = sqrt(4*a*c-b*b)/(2*a);
		cout<<fixed<<setprecision(5)<<"x1="<<xr<<"+"<<xi<<"i;x2="<<xr<<"-"<<xi<<"i"<<endl;
		}

	else
	{
		x1 = (-b + sqrt(b*b-4*a*c))/(2*a);
     	x2 = (-b - sqrt(b*b-4*a*c))/(2*a);
     	if (fabs(x1)<(1e-6)) x1 = 0;
     	if (fabs(x2)<(1e-6)) x2 = 0;
     	cout<<fixed<<setprecision(5)<<"x1="<<x1<<";x2="<<x2<<endl;
	}
	}
	return 0;
}
/**
 * @file    1.cpp              
 * @author  ??? 1100013230               
 * @date    2011-9-16         
 * @descrption        
 *          ???????????????          
*/
int main()
{
	int n,k;                                     
	cin>>k;                                      //??????????k
	 for(n=1;n<=k;n=n+1)                         
	 {  
		 float a,b,c;                           //a?b?c?????????????????????
		 double x1,x2,x11,x22;                  //x1?x2????????????x11,x22??????????
		  cin>>a>>b>>c;
	     if ((b*b-4*a*c)>0)                     //??b*b-4*a*c?0???
		 {
		     x1 = (0-b+sqrt(b*b-4*a*c))/(2*a);
             x2 = (0-b-sqrt(b*b-4*a*c))/(2*a);   //????
			 cout<<fixed;
		     cout<<"x1="<<setprecision(5)<<x1<<";"<<"x2="<<setprecision(5)<<x2<<endl; //?????????????
		 }
		 else
		 {
		     if ((b*b-4*a*c)<0)               //??b*b-4*a*c?0???
			 {    
				 x1=x2=(0-b)/(2*a);
			     x11=sqrt(-b*b+4*a*c)/(2*a);
			     x22=-sqrt(-b*b+4*a*c)/(2*a);  //????
				 cout<<fixed;
				 cout<<"x1="<<setprecision(5)<<x1<<"+"<<setprecision(5)<<x11<<"i"<<";"<<"x2="<<setprecision(5)<<x2<<setprecision(5)<<x22<<"i"<<endl;
			 }                                 //?????????????
		     else
             {
		       x1=x2= (0-b + sqrt(b*b-4*a*c))/(2*a);  //????
			   cout<<fixed;
			   cout<<"x1=x2="<<setprecision(5)<<x1<<endl;  //?????????????
			 }
		 }
	 }
	 return 0;
}
int main()
 {
	 int n,i,j;
	 scanf("%d",&n);
	 struct data{
		 double a,b,c;
	 }*datas;
	 datas=(struct data*)malloc(sizeof(data)*n);
	 for (i=0;i<n;i++)
	 {
		 scanf("%lf%lf%lf",&datas[i].a,&datas[i].b,&datas[i].c);
	 }
	 double *x1,*x2;
	 x1=(double*)malloc(sizeof(double)*n);
	 x2=(double*)malloc(sizeof(double)*n);
	 for (j=0;j<n;j++)
	 {
		 if ((datas[j].b*datas[j].b-4*datas[j].a*datas[j].c)>0)
		 {
			 x1[j]=(-datas[j].b+sqrt(datas[j].b*datas[j].b-4*datas[j].a*datas[j].c))/(2*datas[j].a);
			 x2[j]=(-datas[j].b-sqrt(datas[j].b*datas[j].b-4*datas[j].a*datas[j].c))/(2*datas[j].a);
		     printf("x1=%.5f;x2=%.5f\n",x1[j],x2[j]);
		 }
		 else if ((datas[j].b*datas[j].b-4*datas[j].a*datas[j].c)==0)
		 {
			 x1[j]=(-datas[j].b)/(2*datas[j].a);
			 printf("x1=x2=%.5f\n",x1[j]);
		 }
		 else if ((datas[j].b*datas[j].b-4*datas[j].a*datas[j].c)<0)
		 {
			 x1[j]=(-datas[j].b)/(2*datas[j].a);
			 double x=0;
			 x=sqrt((-1)*(datas[j].b*datas[j].b-4*datas[j].a*datas[j].c))/(2*datas[j].a);
			 if (x1[j]==0)
			 {
				 printf("x1=0.00000+%.5fi;x2=0.00000-%.5fi\n",x,x);
			 }
			 else if (x1[j]!=0)
			 {
				 printf("x1=%.5f+%.5fi;x2=%.5f-%.5fi\n",x1[j],x,x1[j],x);
			 }
		 }
	 }
	 return 0;
 }