Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- double distance(int *a, int *b, int *c, int *d){
- return sqrt(((*a-*c)*(*a-*c))+((*b-*d)*(*b-*d)));
- }
- int main() {
- int x1,y1,x2,y2;
- cin>>x1>>y1>>x2>>y2;
- int *a = &x1;
- int *b = &y1;
- int *c = &x2;
- int *d = &y2;
- cout<<distance(&x1,&y1,&x2,&y2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement