Cod sursa(job #1014197)
| Utilizator | Data | 22 octombrie 2013 12:47:25 | |
|---|---|---|---|
| Problema | Cele mai apropiate puncte din plan | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.63 kb |
#include <iostream>
#include<math.h>
using namespace std;
float f(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.int");
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=f(v[1],w[1],v[2],w[2]);
for(i=1; i<=n; i++)
for(j=i+1; j<=n; j++)
{
yu=f(v[i],w[i],v[j],w[j]);
if(max<yu)
max=yu;
}
return 0;
g<<max;
f.close();
g.close();
return 0;
}
