|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
#include <math.h>
void main()
{
double a,b,c,disc,x1,x2,p,q;
scanf("a=%lf,b=%lf,c=%lf",&a,&b,&c);
disc=b*b-4*a*c;
p=-b/(2*a);
q=sqrt(disc)/(2*a);
x1=p+q;
x2=p-q;
printf("\nx1=%5.2f\nx2=%5.2f\n",x1,x2);
}
--------------------Configuration: 02 - Win32 Debug--------------------
Compiling...
02.cpp
D:\MSDev98\MyProjects\02\02.cpp(5) : error C2065: 'scanf' : undeclared identifier
D:\MSDev98\MyProjects\02\02.cpp(11) : error C2065: 'printf' : undeclared identifier
|
|