class A {
public:
double p1, p2;
virtual double fun(double, double) = 0;
};
class B: public A {
public:
double fun(double, double) {};
};
class C: public A {
public:
double fun(double, double) {};
};
void proc(A** a) {
}
int main() {
B b;
C c;
A* a[2];
a[0]=&b;
a[1]=&c;
proc(a);
}
Y2xhc3MgQSB7CnB1YmxpYzoKICAgIGRvdWJsZSBwMSwgcDI7CiAgICB2aXJ0dWFsIGRvdWJsZSBmdW4oZG91YmxlLCBkb3VibGUpID0gMDsKfTsKCmNsYXNzIEI6IHB1YmxpYyBBIHsKcHVibGljOgogICAgZG91YmxlIGZ1bihkb3VibGUsIGRvdWJsZSkge307Cn07CgpjbGFzcyBDOiBwdWJsaWMgQSB7CnB1YmxpYzoKICAgIGRvdWJsZSBmdW4oZG91YmxlLCBkb3VibGUpIHt9Owp9OwoKdm9pZCBwcm9jKEEqKiBhKSB7Cn0KCmludCBtYWluKCkgewogICAgQiBiOwogICAgQyBjOwogICAgQSogYVsyXTsKICAgIGFbMF09JmI7CiAgICBhWzFdPSZjOwoKICAgIHByb2MoYSk7Cn0K