Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main()
- {
- setlocale(0, "");
- int x, y, x1, y1, d;
- cout << "Введите координаты точки A (x1,y1): ";
- cin >> x >> y;
- cout << "Введите координаты точки B (x2,y2): ";
- cin >> x1 >> y1;
- d = sqrt(x*x + y*y) - sqrt(x1*x1 + y1*y1);
- if (abs(d) < 1e-8) {
- cout << "Точки A и B равноудалены от начала координат.";
- }
- else {
- cout << "Наименее удалённая от координат О(0, 0) является точка: ";
- d < 0 ? printf("A.") : printf("B.");
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement