#include using namespace std; struct myshot{ private: int a; int b; public: myshot(){} myshot(int a1, int b1) { a = a1; b = b1; } int getA() { return a; } int getB() { return b; } }; myshot operator+(myshot a, myshot b) { int newA = a.getA() * b.getB() + a.getB() * b.getA(); int newB = a.getB() * b.getB(); return myshot(newA, newB); } myshot operator-(myshot a, myshot b) { int newA = a.getA() * b.getB() - a.getB() * b.getA(); int newB = a.getB() * b.getB(); return myshot(newA, newB); } myshot operator*(myshot a, myshot b) { int newA = a.getA() * b.getA(); int newB = b.getB() * b.getB(); return myshot(newA, newB); } int main() { myshot a(1, 2); myshot b(2, 3); myshot c; c = a + b; cout << c.getA() << c.getB(); }