#include using namespace std; class opor { double r; public: opor(void); opor(double x); opor operator+(const opor&); opor operator*(const opor&); double show(); }; opor::opor(void){ r = 0; } opor::opor(double x){ r = x; } opor opor::operator+ (const opor& x){ opor suma; suma.r = r + x.r; return suma; } opor opor::operator* (const opor& x){ opor suma; suma.r = 1.0/(1.0/r + 1.0/x.r); return suma; } double opor::show(){ return r; } int main(int argc, char **argv) { opor r1(2), r2(2); opor r3; r3 = (r1 + r2) * (r1 * r2); cout << r3.show() << endl; return 0; }