Untitled

mail@pastecode.io avatar
unknown
c_cpp
14 days ago
370 B
1
Indexable
Never
#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);
}
Leave a Comment