这是什么问题?
# include <stdio.h># include <math.h>
int main(void)
{
//把一元二次方程的三个系数存入计算机中
int a = 1;
int b = 2;
int c = 3;
double delta;
double x1;
double x2;
delta = b*b - 4*a*c;
if(delta > 0)
{
x1 = (-b + sqrt(delta)) / (2*a);
x2 = (-b - sqrt(delta)) / (2*a);
printf("这个一元二次方程有两个解,x1 = %f, x2 = %f\n" x1, x2);
}
else if(delta == 0)
{
x1 = x2 = (-b) / (2*a);
printf("这个一元二次方程有一个解,x1 = x2 = %f\n" x1, x2);
}
else
printf("这个一元二次无解!\n");
return 0;
}
用VC++ 6.0编译出来,出现error C2146: syntax error : missing ')' before identifier 'x1'这个是什么错误啊?