#include using namespace std; class Timer { public: int a, *pa = &a; void funcTimer(int at, int bt, int ct) { a = at; b = bt; c = ct; }; void funcTResult() { cout << "a=" << a << " b=" << b << " c=" << c << endl; }; private: int b; protected: int c, *pc = &c; }; class Clock : public Timer { public: int x, *px = &x; void funcClock(int xt, int yt, int zt) { x = xt; y = yt; z = zt; }; void funcCResult() { cout << "a=" << *pa << " c=" << *pc << " x=" << x << " y=" << y << " z=" << z << endl; }; private: int y; protected: int z, *pz = &z; }; class Hand : public Clock { public: int i, *pi = &i; void funcHand(int it, int jt, int kt) { i = it; j = jt; k = kt; }; void funcHResult() { cout << "a=" << *pa << " c=" << *pc << " x=" << *px << " z=" << *pz << " i=" << i << " j=" << j << " k=" << k << endl; }; private: int j; protected: int k, *pk = &k; }; void main() { int a, b, c, x, y, z, i, j, k; cout << "a="; cin >> a; cout << "b="; cin >> b; cout << "c="; cin >> c; cout << "x="; cin >> x; cout << "y="; cin >> y; cout << "z="; cin >> z; cout << "i="; cin >> i; cout << "j="; cin >> j; cout << "k="; cin >> k; Timer A; Clock B; Hand C; A.funcTimer(a, b, c); A.funcTResult(); B.funcClock(x, y, z); B.funcCResult(); C.funcHand(i, j, k); C.funcHResult(); }