C语言二元一次方程,# include # include int main(void){//把三个系数保存到计算机中int a = 1:int b = 2:int c = 3:double detla:double x1:double x2:detla = b*b - 4*a*c:if (delta > 0){x1 = (-b + sqrt(delta)) / (2*a):x2 = (-b - sqrt(delta

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/27 14:46:16
C语言二元一次方程,#include#includeintmain(void){//把三个系数保存到计算机中inta=1:intb=2:intc=3:doubledetla:doublex1:doub

C语言二元一次方程,# include # include int main(void){//把三个系数保存到计算机中int a = 1:int b = 2:int c = 3:double detla:double x1:double x2:detla = b*b - 4*a*c:if (delta > 0){x1 = (-b + sqrt(delta)) / (2*a):x2 = (-b - sqrt(delta
C语言二元一次方程,
# include
# include
int main(void)
{
//把三个系数保存到计算机中
int a = 1:
int b = 2:
int c = 3:
double detla:
double x1:
double x2:
detla = b*b - 4*a*c:
if (delta > 0)
{
x1 = (-b + sqrt(delta)) / (2*a):
x2 = (-b - sqrt(delta)) / (2*a);//这个是引号
printf("该一元二次方程有两个解,xi = %f,x2 = %f\n",x1,x2):
}
else if (delta == 0)
{
x1 = (-b) / (2*a):
x2 = x1;//这个是引号
printf("该一元二次方程有两个相同解,x1 = x2 = %f\n",x1,x2):
}
else
{
printf("无解\n"):
}
return 0:
}

C语言二元一次方程,# include # include int main(void){//把三个系数保存到计算机中int a = 1:int b = 2:int c = 3:double detla:double x1:double x2:detla = b*b - 4*a*c:if (delta > 0){x1 = (-b + sqrt(delta)) / (2*a):x2 = (-b - sqrt(delta
C语言结尾是分号啊; 你打个冒号
中间你把detla打成delta
最后 是一元二次方程