随便输了数,竟然无解,很费解
# include <stdio.h># include <math.h>
int main(void)
{
int a;
int b;
int c;
scanf ("%d,%d,%d",&a,&b,&c);
int deblt;
double x1;
double x2;
deblt = b*b-4*a*c;
if(deblt>0)
{
x1=(-b)+sqrt(deblt)/2*a;
x1=(-b)-sqrt(deblt)/2*a;
printf("x1=%d\n,x2=%d\n",x1,x2);
}
else if(deblt==0)
{
x1=(-b)/2*a;
x2=x1;
printf("x1=x2=%d\n",x1,x2);
}
else if(deblt<0)
{
printf("wujie\n");
}
return 0;
}