Skip to content

Instantly share code, notes, and snippets.

@sofhiasouza
Created June 10, 2019 17:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sofhiasouza/059fadd3a03004f822673230163af381 to your computer and use it in GitHub Desktop.
Save sofhiasouza/059fadd3a03004f822673230163af381 to your computer and use it in GitHub Desktop.
#include <bits/stdc++.h>
using namespace std;
struct ponto
{
int x, y;
double dist(ponto q)
{
int r1 = x - q.x;
int r2 = y - q.y;
return sqrt(r1*r1 + r2*r2);
}
};
int main()
{
ponto a, b;
cin >> a.x >> a.y >> b.x >> b.y;
cout << a.dist(b) << endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment