vc6.0 编译报错,提示编译时老是会出现: error C2143: syntax error : missing ';' before 'constant'
编译时老是会出现:error C2143: syntax error : missing ';' before 'constant'的报错。求解答~~谢啦代码如下
# include <stdio.h>
# include <math.h>
int main(void)
{
int a=1; //定义变量,把三个系数保存到计算机中
int b=2;
int c=3;
float del ; //delta是b*b-4*a*c
float x1,x2 ; //定义方程的两个解
delta = b*b - 4*a*c;
if (del > 0)
{
x1 = ( -b + sqrt(del) )/(2*a);
x2 = ( -b - sqrt(del) )/(2*a);
printf("该一元二次方程有两个解,x1 = %f,x2= %f\n",x1,x2);
}
else if(del == 0)
{
x1=(-b)/(2*a);
x2=x1;
printf("该一元二次方程有一个解,x1=%f\n",x1);
}
else if (del < 0)
{
printf("该一元二次方程无解\n");
}
reture 0;
}