Cod sursa(job #1014211)
| Utilizator | Data | 22 octombrie 2013 12:53:19 | |
|---|---|---|---|
| Problema | Cele mai apropiate puncte din plan | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.65 kb |
#include <iostream>
#include<fstream>
#include<math.h>
using namespace std;
float fun(float a,float b,float x,float y)
{
float s;
s=sqrt((a-x)*(a-x)+(b-y)*(b-y));
return s;
}
int main()
{
ifstream f("cmap.in");
ofstream g("cmap.out");
float max,v[10001],w[100001],yu;
long n,i,j;
f>>n;
for(i=1; i<=n; i++)
f>>v[i]>>w[i];
max=fun(v[1],w[1],v[2],w[2]);
for(i=1; i<=n; i++)
for(j=i+1; j<=n; j++)
{
yu=fun(v[i],w[i],v[j],w[j]);
if(max<yu)
max=yu;
}
return 0;
g<<max;
f.close();
g.close();
return 0;
}
