1 solutions

  • 0
    @ 2025-9-29 13:55:06
    #include <bits/stdc++.h>
    double n(double a , double b , double c , double d){
        double x = pow (c - a , 2);
        double y = pow (d - b , 2);
        double dis = sqrt (x + y);
        return dis;
    }
    using namespace std;
    int main(){
        double x1 , y1 , x2 , y2 , x3 , y3;
        cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
        double a = n (x1 , y1 , x2 , y2);
        double b = n (x2 , y2 , x3 , y3);
        double c = n (x3 , y3 , x1 , y1);
        printf("%.2lf",a + b + c);
        return 0;
    }
    
    • 1

    Information

    ID
    4712
    Time
    1000ms
    Memory
    125MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    2
    Accepted
    2
    Uploaded By