formula distantei dintre 2 puncte oarecare (notate A si B) este radical(xB - xA)^2 + (yB - yA)^2
vei avea asa: d = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
Avem programul c++:
#include <bits/stdc++.h>
using namespace std;
int main(){ int x1, x2, y1, y2, n; float d; cin >> x1 >> y1 >> x2 >> y2; d = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); d = d * 100; n = (int) d; cout << fixed << setprecision(2) << (float) n / 100; return 0;}