这个我编译过了.肯定可以.而且简单.#include"stdio.h"#include"math.h"void main(){ float a,b,c; printf("%s\n","Please Input a,b,c"); scanf("%f%f%f",&a,&b,&c); if((b*b-4*a*c)0"); else {printf("X1=%2f\n",(-b+sqrt(b*b-4*a*c))/2*a);printf("X2=%2f\n",(-b-sqrt(b*b-4*a*c))/2*a); }}
|