Untitled
unknown
c_cpp
2 years ago
370 B
6
Indexable
#include <iostream>
#include <cmath>
using namespace std;
float distance(float x1, float y1, float x2, float y2) {
float rasst;
rasst = abs(sqrt((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1)));
cout << rasst;
return rasst;
}
int main() {
setlocale(LC_ALL, "Russian");
float x1, y1, x2, y2;
cin >> x1 >> y1 >> x2 >> y2;
distance(x1, y1, x2, y2);
}
Editor is loading...
Leave a Comment