struct Complex{
double a,b;
Complex(double _a = 0.0, double _b = 0.0){
a = _a; b = _b;
}
Complex operator - (const Complex& rhs) const{
return Complex(a-rhs.a, b-rhs.b);
}
Complex operator + (const Complex& rhs) const{
return Complex(a+rhs.a, b+rhs.b);
}
Complex operator * (const Complex& rhs) const{
return Complex(a*rhs.a-b*rhs.b, a*rhs.b+b*rhs.a);
}
};
复数
最新推荐文章于 2024-03-02 20:10:39 发布