#include<iostream> using namespace std; class A { public: void hello(){cout<<"基类A的hello函数"<<endl;} }; class B { public: void hello(){cout<<"基类B的hello函数"<<endl;} void print(){cout<<"基类B的print函数"<<endl;} }; class C:public A,public B { public: void print(){cout<<"子类C的print函数"<<endl;} }; int main() { C c; c.A::hello(); c.B::hello(); c.B::print(); c.print(); A a; B b; a.hello(); b.print();