c语言程序设计题目:计算一元二次方程的根【程序填空】#include //else if(【?】){x1=(-b+sqrt(disc))/(2*a);x2=(-b-sqrt(disc))/(2*a);printf("has distinct real roots:%8.4f and %.4f\n",x1,x2);}else{realpart=-b/(2*a);imagpart=sqrt(-di
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/16 00:52:36
c语言程序设计题目:计算一元二次方程的根【程序填空】#include //else if(【?】){x1=(-b+sqrt(disc))/(2*a);x2=(-b-sqrt(disc))/(2*a);printf("has distinct real roots:%8.4f and %.4f\n",x1,x2);}else{realpart=-b/(2*a);imagpart=sqrt(-di
c语言程序设计题目:计算一元二次方程的根
【程序填空】
#include
//
else if(【?】)
{x1=(-b+sqrt(disc))/(2*a);
x2=(-b-sqrt(disc))/(2*a);
printf("has distinct real roots:%8.4f and %.4f\n",x1,x2);
}
else
{realpart=-b/(2*a);
imagpart=sqrt(-disc)/(2*a);
printf("has complex roots:\n");
printf("%8.4f=%.4fi\n",realpart,imagpart);
printf("%8.4f-%.4fi\n",realpart,imagpart);
}
}
c语言程序设计题目:计算一元二次方程的根【程序填空】#include //else if(【?】){x1=(-b+sqrt(disc))/(2*a);x2=(-b-sqrt(disc))/(2*a);printf("has distinct real roots:%8.4f and %.4f\n",x1,x2);}else{realpart=-b/(2*a);imagpart=sqrt(-di
#include
//
else if(disc>0)
{
x1=(-b+sqrt(disc))/(2*a);
x2=(-b-sqrt(disc))/(2*a);
printf("has distinct real roots:%8.4f and %.4f\n",x1,x2);
}
else
{
realpart=-b/(2*a);
imagpart=sqrt(-disc)/(2*a);
printf("has complex roots:\n");
printf("%8.4f+%.4fi\n",realpart,imagpart);
printf("%8.4f-%.4fi\n",realpart,imagpart);
}
}
}
2 -3 -5
the equationhas distinct real roots:2.5000 and -1.0000
Press any key to continue