warning C4700: local variable 'b' used without having been initialized
#include<iostream.h>#include<math.h>intmain(){inta,b,c;if(pow(b,2)-4*a*c<0)cout<<"无解"...
#include<iostream.h>
#include<math.h>
int main()
{
int a,b,c;
if(pow(b,2)-4*a*c<0)
cout<<"无解"<<endl;
else if(pow(b,2)-4*a*c>0)
cout<<"x1="<<(-b+sqrt(pow(b,2)-4*a*c))/2*a<<"x2="<<(-b-sqrt(pow(b,2)-4*a*c))/2*a<<endl;
return 0;
}
怎么改??? 展开
#include<math.h>
int main()
{
int a,b,c;
if(pow(b,2)-4*a*c<0)
cout<<"无解"<<endl;
else if(pow(b,2)-4*a*c>0)
cout<<"x1="<<(-b+sqrt(pow(b,2)-4*a*c))/2*a<<"x2="<<(-b-sqrt(pow(b,2)-4*a*c))/2*a<<endl;
return 0;
}
怎么改??? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询