Advertisement
Filip13

rastojanje tacaka

Oct 3rd, 2022 (edited)
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7. double ax, ay, bx, by;
  8. cin >> ax;
  9. cin >> ay;
  10. cin >> bx;
  11. cin >> by;
  12.  
  13. double x = abs(ax - bx);
  14. double y = abs(ay - by);
  15.  
  16. double r1 = pow(x, 2) + pow(y, 2);
  17. double r = sqrt(r1);
  18.  
  19. cout << fixed << setprecision(5) << r;
  20.  
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement