有人可以告诉我为什么我无法编译以下程序:
#include<iostream>
#include<string>
#include<cmath>
#include<iostream>
#include<cfloat>
#define MOD 10000009
using namespace std;
double distance(pair<int,int> p1,pair<int,int> p2)
{
double dist;
dist = sqrt( (p1.first-p2.first)*(p1.first-p2.first) + (p1.second-p2.second)*(p1.second-p2.second) );
return(dist);
}
int main()
{
int N,i,j;
cin >> N;
pair<int,int> pi[N];
for(i=0;i<N;i++)
{
cin >> pi[i].first >> pi[i].second;
}
for(i=0;i<N;i++)
{
cout << pi[i].first << " "<< pi[i].second << endl;
}
distance(pi[0],pi[1]); // This line is giving error
return 0;
}