题目描述
616.两点间的距离
C++ 代码
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main()
{
double x1, y1, x2, y2;
cin >> x1 >> y1 >> x2 >> y2;
printf("%.4lf", sqrt(pow(x2-x1, 2) + pow(y2-y1, 2))); //sqrt():用来求给定值的平方根,pow(x,y):x的y次幂
return 0;
}
CSDN:铜锣烧GZQ