Advertisement
Lavig

Другий семестр. Лабораторна робота №18 (Завдання 3, модуль)

May 20th, 2025
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. export module my_point;
  2.  
  3. export class Point {
  4. public:
  5.     int x, y;
  6.     Point(int x = 0, int y = 0) : x(x), y(y) {}
  7.     Point operator+(const Point& other) const {
  8.         return Point(x + other.x, y + other.y);
  9.     }
  10.     Point operator-(const Point& other) const {
  11.         return Point(x - other.x, y - other.y);
  12.     }
  13. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement