高手给看一下这个问题出在哪了,这样写不行吗
#include "stdio.h"#include "math.h"
int main(void)
{
int a=1;
int b =5;
int c =6;
double delta;
double x1,x2;
delta = (b*b)-(4*a*c);
while(delta > 0)
{
x1 = ((-b)+sqrt(delta)) / (2*a);
x2 = ((-b)-sqrt(delta)) / (2*a);
printf("此方程有两个解。%d %d",x1,x2);
}
while(delta==0)
{
x1=x2=(-b) / (2*a);
x1=x2;
printf("此方程有一个解。x1=x2=%d",x1,x2);
}
printf("无解\n");
return 0;