Untitled
unknown
c_cpp
8 months ago
355 B
4
Indexable
Never
#include <iostream> #include <math.h> using namespace std; double pisun(double x1, double y1, double x2, double y2) { double a = x2 - x1; double b = y2 - y1; double sum = sqrt(a * a + b * b); return sum; } int main() { double x1,y1,x2,y2; cin >> x1 >> y1 >> x2 >> y2; double dist = pisun(x1, y1, x2, y2); cout << dist; }
Leave a Comment