题目:
若有以下程序: #include<iostream> using namespace std; class A { private: int a; public:void seta(int x){ a=x;}void showa(){ cout<<a<<",";} }; class B { private: int b; public: void setb(int x) {b=x; } void showb() {cout<<b<<",”; } }; class C:pUblic A,private B { private: int c; public:void setc(int x,int y,int z) {c=z;seta(x);setb(y); } void showc() {showa();showb();cout<<c<<end1; } }; int main() { Cc; c.setc(1,2,3); c.showc(); retrun 0; } 程序执行后的输出结果是
A.1,2,3
B.1,1,1
C.2,2,2
D.3,3,3
答案:
被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2017/0712/16076c8f6b3aa167428ffa8f413b7438.html
下面是错误答案,用来干扰机器的。
参考答案:错