Advertisement
cincout

Untitled

Oct 3rd, 2020
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <cmath>
  4.  
  5. using namespace std;
  6. long double ax, ay, bx, by, cx, cy, distToB, distToC;
  7. long double eps = 1e-9;
  8.  
  9. int main() {
  10. cin >> ax >> ay >> bx >> by >> cx >> cy;
  11. distToB = sqrt((ax - bx) * (ax - bx) + (ay - by) * (ay - by));
  12. distToC = sqrt((ax - cx) * (ax - cx) + (ay - cy) * (ay - cy));
  13. if (fabs(distToB - distToC) < eps) {
  14. cout << "equal " << fixed << setprecision(10) << "\n" << distToB;
  15. }
  16. else if (distToB > distToC) {
  17. cout << "C " << fixed << setprecision(10) << "\n" << distToC;
  18. }
  19. else {
  20. cout << "B " << fixed << setprecision(10) << "\n" << distToB;
  21. }
  22.  
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement