Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- import my_point;
- using namespace std;
- int main() {
- SetConsoleOutputCP(1251);
- SetConsoleCP(1251);
- int x1{}, y1{}, x2{}, y2{};
- cout << "Введіть координати першої точки (x y): ";
- cin >> x1 >> y1;
- cout << "Введіть координати другої точки (x y): ";
- cin >> x2 >> y2;
- Point p1(x1, y1);
- Point p2(x2, y2);
- Point sum = p1 + p2;
- Point diff = p1 - p2;
- cout << "Сума: (" << sum.x << ", " << sum.y << ")" << endl;
- cout << "Різниця: (" << diff.x << ", " << diff.y << ")" << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement