大师们,求围观!!!
local variable 'b' used without having been initializedlocal variable 'a' used without having been initialzed
warning C4700: local variable 'c' used without having been initialized
我的程序一直是输出“无解”
# include <stdio.h>
# include <math.h>
int main(void)
{
double a,b,c;
double x1,x2;
double delta;
printf("请输入三个数值\n");
delta = b * b - 4 * a * c ;
printf("a = ");
scanf("%lf",&a);
printf("b = ");
scanf("%lf",&b);
printf("c = ");
scanf("%lf",&c);
do
{
if(delta > 0)
{
x1 = (-b+sqrt(delta))/(2*a);
x2 = (-b-sqrt(delta))/(2*a);
printf("x1= %lf,x2 = %lf\n",x1,x2);
}
if(delta == 0)
{
x1 = (-b)/(2*a);
x2 = x1;
printf("x1 = x2 =%lf\n");
}
else if(delta < 0)
{
printf("无解\n");
}
}while(1);
return 0;
}