求调

P5735 【深基7.例1】距离函数

Kingson999 @ 2024-07-10 20:04:15

#include<bits/stdc++.h>
using namespace std;
double ch(int a,int b,int c,int d){
    double ret=sqrt(abs((a-c)*(a-c))+abs((b-d)*(b-d)));
    return ret;
}
int main(){
    int a,b,c,d,e,f;
    cin>>a>>b>>c>>d>>e>>f;
    double ret=ch(a,b,c,d)+ch(a,b,e,f)+ch(c,d,e,f);
    printf("%.2f",ret);
 } 

by Kingson999 @ 2024-07-10 20:05:53

最后一个样例没过死亡回放


by call_of_silence @ 2024-07-10 20:11:24

@Kingson999 坐标是实数


by Kingson999 @ 2024-07-10 20:19:25

@call_of_silence 谢谢已关


|