Untitled

mail@pastecode.io avatar
unknown
c_cpp
14 days ago
407 B
0
Indexable
Never

#include <math.h>
#include <iostream>
using namespace std;

double distance(double x1, double y1, double x2, double  y2) {
	double a;
	double b;
	a = y1 - y2;
	b = x1 - x2;
	double g;
	g = sqrt((a * a) + (b * b));
	return g;
}

int main()
{
	double x1;
	double y1;
	double x2;
	double y2;
	cin >> x1 >> y1 >> x2 >> y2;
	double otvet = distance(x1, y1, x2, y2);
	cout << otvet;
}
Leave a Comment