问题描述:
关于C语言,能够运行,但是在disc等于0和大于0时不对.
//
#include "stdio.h"
#include "math.h"
void main()
{
\x05double a,b,c,disc,x1,x2,p,q;
\x05printf("please input 3 num:\n");
\x05scanf("%lf %lf %lf",&a,&b,&c);
\x05disc=b*b-4*a*c;
\x05if (a==0)
\x05{
\x05\x05x1=-c/b;
\x05\x05printf("x1=%7.2f\n",x1);
\x05}
\x05else
\x05{
\x05\x05if (disc
//
#include "stdio.h"
#include "math.h"
void main()
{
\x05double a,b,c,disc,x1,x2,p,q;
\x05printf("please input 3 num:\n");
\x05scanf("%lf %lf %lf",&a,&b,&c);
\x05disc=b*b-4*a*c;
\x05if (a==0)
\x05{
\x05\x05x1=-c/b;
\x05\x05printf("x1=%7.2f\n",x1);
\x05}
\x05else
\x05{
\x05\x05if (disc
问题解答:
我来补答展开全文阅读