Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- typedef struct
- {
- double x;
- double y;
- } Point;
- double distance(const Point& a, const Point& b)
- {
- return sqrt((a.x - b.x)*(a.x - b.x) + (a.y - b.y)*(a.y - b.y));
- }
- int main()
- {
- Point a, b;
- cin >> a.x >> a.y >> b.x >> b.y;
- cout << distance(a, b) << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment