#include <iostream>
using namespace std;
class A
{
public:
virtual void func()
{
std::cout<<"in A's func "<<std::endl;
}
};
class B : public A
{
};
class C : public B
{
public:
void func()
{
std::cout<<"in C's func "<<std::endl;
}
};
int main() {
// your code goes here
A* obj = new A();
obj->func();
A* obj2 = new B();
obj2->func();
A* obj3 = new C();
obj3->func();
B* obj5 = new B();
obj5->func();
B* obj6 = new C();
obj6->func();
C* obj7 = new C();
obj7->func();
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY2xhc3MgQQp7CnB1YmxpYzoKdmlydHVhbCB2b2lkIGZ1bmMoKQp7CglzdGQ6OmNvdXQ8PCJpbiBBJ3MgZnVuYyAiPDxzdGQ6OmVuZGw7Cn0KfTsKCmNsYXNzIEIgOiBwdWJsaWMgQQp7Cgp9OwoKY2xhc3MgQyA6IHB1YmxpYyBCCnsKCnB1YmxpYzoKdm9pZCBmdW5jKCkKewoJc3RkOjpjb3V0PDwiaW4gQydzIGZ1bmMgIjw8c3RkOjplbmRsOwp9CQp9OwoKaW50IG1haW4oKSB7CgkvLyB5b3VyIGNvZGUgZ29lcyBoZXJlCglBKiBvYmogPSBuZXcgQSgpOwoJb2JqLT5mdW5jKCk7CgkKCUEqIG9iajIgPSBuZXcgQigpOwoJb2JqMi0+ZnVuYygpOwoJCglBKiBvYmozID0gbmV3IEMoKTsKCW9iajMtPmZ1bmMoKTsKCQoJQiogb2JqNSA9IG5ldyBCKCk7CglvYmo1LT5mdW5jKCk7CgkKCUIqIG9iajYgPSBuZXcgQygpOwoJb2JqNi0+ZnVuYygpOwoJCglDKiBvYmo3ID0gbmV3IEMoKTsKCW9iajctPmZ1bmMoKTsKCQoJcmV0dXJuIDA7Cn0=