Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <cmath>
- using namespace std;
- long double ax, ay, bx, by, cx, cy, distToB, distToC;
- long double eps = 1e-9;
- int main() {
- cin >> ax >> ay >> bx >> by >> cx >> cy;
- distToB = sqrt((ax - bx) * (ax - bx) + (ay - by) * (ay - by));
- distToC = sqrt((ax - cx) * (ax - cx) + (ay - cy) * (ay - cy));
- if (fabs(distToB - distToC) < eps) {
- cout << "equal " << fixed << setprecision(10) << "\n" << distToB;
- }
- else if (distToB > distToC) {
- cout << "C " << fixed << setprecision(10) << "\n" << distToC;
- }
- else {
- cout << "B " << fixed << setprecision(10) << "\n" << distToB;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement