Advertisement
Guest User

Untitled

a guest
Oct 16th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. for (int i = 0; i < lines_n; i++) {
  2.             cin >> x1 >> y1 >> x2 >> y2;
  3.             distance = sqrt(pow(y1 - y2, 2) + pow(x1 - x2, 2));
  4.             if (distance - max_distance > 0) {
  5.                 max_distance = distance;
  6.                 max_distance_n = 1;
  7.             } else if (distance == max_distance || abs(distance - max_distance) / (abs(distance) + abs(max_distance)) < EPS) {
  8.                 max_distance_n++;
  9.             }
  10.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement