Untitled
#include <iostream> #include <cmath> using namespace std; float distance(float x, float y, float x1, float y1) { return sqrt(pow(x1 - x, 2) + pow(y1-y, 2)); } int main() { float x, y, x1, y1; cin >> x >> y >> x1 >> y1; cout << distance(x, y, x1, y1); }
Leave a Comment