下面程序的运行结果是 ( ) #include using namespace std; class A { public: A(int i) { m_i = i; } A(const A& a) { m_i = a.m_i; } int getI() { return m_i; } private: int m_i; }; class B: public A { public: B(int i, int j): A(i), m_j(j) {} B(const B& b): A(b) { m_j = 2 * b.m_j; } void print() { cout << "i of A: " << getI() << ", j of B: " << m_j << endl; } private: int m_j; }; int main() { B b0(5, 8); b0.print(); B b1(b0); b1.print(); return 0; }
A.
i of A: 5, j of B: 8 i of A: 5, j of B:16
B.
i of A: 5, j of B: 8 i of A: 10, j of B:8
C.
i of A: 5, j of B: 8 i of A: 5, j of B:8
D.
i of A: 5, j of B: 8 i of A: 10, j of B:16