二元一次方程,有错。大神帮忙看看
# include <stdio.h># include <math.h>
int main (void)
{
double a,b,c,x1,x2,delta;
printf("请输入系数a= ");
scanf("%lf",&a);
printf("请输入系数b= ");
scanf("%lf",&b);
printf("请输入系数c= ");
scanf("%lf",&c);
delta = b * b - 4 * a * c;
do
{
if (b*b-4*a*c>0)
{
x1=(-b + sqrt(delta)) / (2 * a);
x2=(-b - sqrt(delta)) / (2 * a);
printf("有两个解x1=%lf,x2=%lf/n",x1,x2);
}
if else (b*b-4*a*c==0)
{
x1=(-b)/(2*a)
printf("有唯一解x1=x2=%lf/n",x1);
}
else
{
printf("无解/n");
}
} while(1);
return 0;
}
--------------------Configuration: 一元二次方程 - Win32 Debug--------------------
Compiling...
一元二次方程.cpp
F:\c\一元二次方程.cpp(6) : error C2018: unknown character '0xa3'
F:\c\一元二次方程.cpp(6) : error C2018: unknown character '0xbb'
F:\c\一元二次方程.cpp(7) : error C2146: syntax error : missing ';' before identifier 'scanf'
F:\c\一元二次方程.cpp(8) : error C2018: unknown character '0xa3'
F:\c\一元二次方程.cpp(8) : error C2018: unknown character '0xbb'
F:\c\一元二次方程.cpp(9) : error C2146: syntax error : missing ';' before identifier 'scanf'
F:\c\一元二次方程.cpp(10) : error C2018: unknown character '0xa3'
F:\c\一元二次方程.cpp(10) : error C2018: unknown character '0xbb'
F:\c\一元二次方程.cpp(11) : error C2146: syntax error : missing ';' before identifier 'scanf'
F:\c\一元二次方程.cpp(25) : error C2059: syntax error : 'else'
F:\c\一元二次方程.cpp(26) : error C2143: syntax error : missing ';' before '{'
F:\c\一元二次方程.cpp(28) : error C2146: syntax error : missing ';' before identifier 'printf'
F:\c\一元二次方程.cpp(30) : error C2181: illegal else without matching if
F:\c\一元二次方程.cpp(32) : error C2018: unknown character '0xa3'
F:\c\一元二次方程.cpp(32) : error C2018: unknown character '0xbb'
F:\c\一元二次方程.cpp(33) : error C2143: syntax error : missing ';' before '}'
执行 cl.exe 时出错.
一元二次方程.obj - 1 error(s), 0 warning(s)
没搞明白,怎么错那么多?又查不出来