/* PISTECLA.CPP */ #include #include class piste { int x,y; public: void tulosta() const {printf("(%d,%d)\n",x,y);} void aseta(int nx,int ny) { x = nx; y = ny; } int x() const { return this->x; } int y() const { return this->y; } }; int main(void) { piste p; p.aseta(3,2); p.tulosta(); p.aseta(7,1); p.tulosta(); cout << p.x() << "\n"; return 0; }