Pagini recente » Cod sursa (job #1405378) | Cod sursa (job #2769781) | Cod sursa (job #1066296) | Clasament lista3 | Cod sursa (job #1622704)
#include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
using namespace std;
ifstream f("cmap.in");
ofstream g("cmap.out");
int N;
double dist(pair<int,int> x, pair<int,int> y)
{
int a=(x.first-y.first)*(x.first-y.first);
int b=(x.second-y.second)*(x.second-y.second);
return sqrt(a+b);
}
int main()
{
f>>N;
vector<pair<int,int> > mapa(N);
for(int i=0; i<N; ++i)
{
f>>mapa[i].first>>mapa[i].second;
}
cout<<dist(mapa[1],mapa[2]);
return 0;
}