Advertisement
Benjamin_Loison

cout << sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));

May 6th, 2017
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.20 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.    double x1, y1, x2, y2;
  8.    cin >> x1; cin >> y1; cin >> x2; cin >> y2;
  9.    cout << sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement