求一元二次方程的实根 函数放在头文件qg.h
double pq(double a,double b,double c){
double disc;
disc=b*b-4*a*c;
return(disc);
}
#include<stdio.h>
#include<math.h>
#include"qg.h"
void main()
{
double a,b,c,x1,x2,p,q,disc;
scanf("%f%f%f",&a,&b,&c);
pq(a,b,c);
p=-b/(2*a);
q=sqrt(disc)/(2*a);
x1=p+q;
x2=p-q;
printf("\n%5.2f\n%5.2f\n",x1,x2);
}