题解:
#include<bits/stdc++.h>
using namespace std;
typedef double tnt;
int n;
tnt x[10001],y[10001];
tnt calc_dis(tnt x1,tnt y1,tnt x2,tnt y2)
{
return sqrt((x1-x2)(x1-x2) + (y1-y2)(y1-y2));
}
int main()
{
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>x[i]>>y[i];
}
//枚举
for(int i=1;i<=n;i++)
{
for(int j=1;j<=n;j++)
{
cout<<fixed<<setprecision(2)<<calc_dis(x[i],y[i],x[j],y[j])<<" ";
}
cout<<'\n';
}
return 0;
}
/*
*/