题目内容:
若有如下程序: #include<iostream> usingnamespacestd; classTestClassl { private: inta; public: TestClassl(inti) { a=i: } voiddisp( ) { cout<<a<<","; } }; classTestClass2 { private: intb: public: TestClass2(intj) { b=j; } voiddisp() { cout<<b<<","; } }; classTestClass3:publicTestClass2,publicTestClassl { private: intc; public: TestClass3(intk):TestClass1(k-2),TestClass2(k+2) { c=k: } voiddisp() { TestClasssl::disp(); TestClasss2::disp(); cout<<c<<endl; } }; intmain() { TestClass30bj(10); obj.disp(); return0; } 程序执行后的输出结果是( )。A.10,10,10
B.10,12,14
C.8,10,12
D.8,12,10
参考答案: