Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4. double distance(int *a, int *b, int *c, int *d){
  5. return sqrt(((*a-*c)*(*a-*c))+((*b-*d)*(*b-*d)));
  6. }
  7. int main() {
  8. int x1,y1,x2,y2;
  9. cin>>x1>>y1>>x2>>y2;
  10. int *a = &x1;
  11. int *b = &y1;
  12. int *c = &x2;
  13. int *d = &y2;
  14. cout<<distance(&x1,&y1,&x2,&y2);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement