Advertisement
Guest User

Untitled

a guest
Oct 20th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. setlocale(0, "");
  9. int x, y, x1, y1, d;
  10. cout << "Введите координаты точки A (x1,y1): ";
  11. cin >> x >> y;
  12. cout << "Введите координаты точки B (x2,y2): ";
  13. cin >> x1 >> y1;
  14. d = sqrt(x*x + y*y) - sqrt(x1*x1 + y1*y1);
  15. if (abs(d) < 1e-8) {
  16. cout << "Точки A и B равноудалены от начала координат.";
  17. }
  18. else {
  19. cout << "Наименее удалённая от координат О(0, 0) является точка: ";
  20. d < 0 ? printf("A.") : printf("B.");
  21. }
  22. system("pause");
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement