#include #include using namespace std; class Punkt{ public: double x, y; double kaugusNullist(){ return sqrt(x*x+y*y); } double kaugusPunktist(Punkt p){ //eukleidiline double dx=p.x-x; double dy=p.y-y; return sqrt(dx*dx+dy*dy); } double manchesteriKaugus(Punkt p){ //mööda risti olevaid tänavaid double dx=p.x-x; double dy=p.y-y; if(dx<0){dx=-dx;} if(dy<0){dy=-dy;} return dx+dy; } }; int main(void){ Punkt p1, p2; p1.x=4; p1.y=2; p2.x=3; p2.y=4; cout << p2.x << endl; cout << p2.kaugusNullist() << endl; cout << p1.kaugusPunktist(p2) << endl; cout << p1.manchesteriKaugus(p2) << endl; return 0; }