> 数学 >
定义一个类,求两数的差,和,商,积
人气:345 ℃ 时间:2020-09-10 02:07:42
解答
class Operation
{
public:
Operation(){};
void SetX(double a)
{
x=a;
}
void SetY(double b)
{
y=b;
}
double Add()
{
return x+y;
}
double Minus()
{
return x-y;
}
double Times()
{
return x*y;
}
double Divided()
{
return x/y;
}
~Operation(){};

private:
double x,y;
};
#include
using namespace std;
void main()
{
Operation x;
double a,b;
couta;
cout
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版