求解释一下
#include <iostream>#include <cmath>
using namespace std;
int main()
{
double yes1(double a, double b, double c);
double yes2(double a, double b, double c);
int a, b, c, d;
cin>>a>>b>>c;
d = b*b-4*a*c;
if (d >= 0)
cout<<"x1="<<yes1(a,b,c)<<" "<<"x2="<<yes2(a,b,c)<<endl;
else
cout<<"无解"<<endl;
return 0;
}
double yes1(double a, double b, double c)
{
int m;
m = (-b + sqrt(b*b-4*a*c))/(a/2);
}
double yes2(double a, double b, double c)
{
int n;
n = (-b - sqrt(b*b-4*a*c))/(a/2);
return n;
}
我在定义两个函数的时候为什么不能将b*b-4*a*c改为d 这里我定义的d不是全局变量吗 为什么不能改成d