Cod sursa(job #2066400)

Utilizator Teodor.mTeodor Marchitan Teodor.m Data 14 noiembrie 2017 23:02:38
Problema Adapost 2 Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.81 kb
#include <bits/stdc++.h>
using namespace std;

ifstream fin("adapost2.in");
ofstream fout("adapost2.out");

const int Nmax = 5e4 + 10;

struct punct {
	double x;
	double y;
}puncte[Nmax];

double dist_a_la_b(punct a, punct b)
{
	return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}

int main()
{
	int n;
	fin >> n;

	for(int i = 1; i <= n; ++i) {
		double x, y;
		fin >> x >> y;
		puncte[i].x = x * 1000;
		puncte[i].y = y * 1000;
	}

	punct centr_greutate;
	int sum_x = 0;
	int sum_y = 0;

	for(int i = 1; i <= n; ++i) {
		sum_x += puncte[i].x;
		sum_y += puncte[i].y;
	}

	centr_greutate.x = sum_x / n;
	centr_greutate.y = sum_y / n;

	int pas = 100;

	while(pas != 1) {
		long long dist1;
		long long dist2;
		long long dist3;
		long long dist4;
	}
	return 0;
}