#include #include using namespace std; struct point { float x; float y; friend istream &operator >> (istream&, point&); }; istream &operator >> (istream& wejscie, point& ex) { wejscie >> ex.x >> ex.y; return wejscie; } class points { public: point **tab; int n; friend ostream& operator<<(ostream&, points const&); points() {} points(int size) { tab= new point*[size]; for(int i=0;ix=i; tab[i]->y=i+1; cout<x<<" "<y<x<y<x; s2 += p.tab[i]->y; } s1 /=p.n; s2 /=p.n; point *result = new point; float x = sqrt(pow(s1-p.tab[0]->x, 2) + pow(s2-p.tab[0]->y, 2)); result = p.tab[0]; for(int i=1;i sqrt(pow(s1 - p.tab[i]->x, 2) + pow(s2 - p.tab[i]->y, 2))) { x = sqrt(pow(s1 - p.tab[i]->x, 2) + pow(s2 - p.tab[i]->y, 2)); result = p.tab[i]; } } return result; } }; int main(){ point p; p.x = 10; p.y = 11; point p2; p.x = 10; p.y = 11; point p3; p.x = 10; p.y = 11; cout << p.x << endl << p.y << endl; points pp(5); cout << pp; point **tab = new point *[3]; tab[0] = &p; tab[1] = &p2; tab[2] = &p3; points ptab; ptab.n = 3; ptab.tab = tab; return 0; }