P5735 【深基7.例1】距离函数
作者:互联网
#include <bits/stdc++.h>
using namespace std;
double dis(double x1, double y1, double x2, double y2) {
return sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
}
int main() {
double x1, y1, x2, y2, x3, y3;
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
printf("%.2lf", dis(x1, y1, x2, y2) + dis(x1, y1, x3, y3) + dis(x3, y3, x2, y2));
return 0;
}
标签:P5735,x1,函数,double,深基,x2,y1,y3,y2 来源: https://www.cnblogs.com/littlehb/p/15575520.html