有如下程序:    #include<iostream>    using namespace std;    class Base{      int x;    public:      Base(int n=0):x(n){cout<<n;)    

admin2009-08-15  18

问题 有如下程序:    #include<iostream>    using namespace std;    class Base{      int x;    public:      Base(int n=0):x(n){cout<<n;)      int getX()const{return x;}    };    class Derived:public Base{      int y;    public:      Derived(int m,int n):y(m,)Base(n){cout<<m;}      Derived(int m):y(m){cout<<m;}    };    int main(){      Derived d1(3),d2(5,7)      return 0;    }运行时的输出结果是

选项 A、375
B、357
C、375
D、357

答案C

解析
转载请注明原文地址:https://jikaoti.com/ti/ivW0FFFM
0

最新回复(0)