#include<stdio.h>
#include<math.h>
#include<iostream>
using namespace std;
int main(){
int a,b,c,A;
int X1,X2;
do
{
cout<<"求一元二次方程式 ax2+bx+c=0 的根請輸入 a,b,c 3個整數:";
cin>>a>>b>>c;
float D=b*b-4*a*c;
X1=((-b)+sqrt(D))/(2*a);
X2=((-b)-sqrt(D))/(2*a);
if(D<0)
cout<<"\n此為無解!!";
else if(X1!=X2)
cout<<"\n此相異根為:"<<X1<<" "<<X2;
else if(X1==X2)
cout<<"\n此為相同根:"<<X1;
cout<<"\n繼續請按1,結束請按0:";
cin>>A;
}while(A==1);
return 0;
}