};
class BB: public }{/*类体略*/}; int main(){
BB x_ ; //1 x .n=1; //2 x.setN (2); //3 x.k=3; //4 x .setK(4); return 0; }
在标注号码的四条语句中正确的是 A)1 B)2 C)3 D)4
(31)有如下类定义: class XX{ int xx; public:
XX():xx(0){cout<<' A';}
XX(int n):xx ( n){tout<<' B';} };
Class YY:public XX{ Int yy; public:
YY():yy ( 0){cout+yy;}
YY(int n):XX(n+1),yy(n){cout<<yy;}
YY (int m, int n):XX (m),yy(n){cout<<yy;} };
下列选项中,输出结果为A0的语句是 A)YY y1(0,0); B)YY y2(1); C)YY y3(0); D)YY y4;
(32)有如下程序: #include<iostream> Using namespace std; class A{ public:
virtual void f(){cout+1;} void g(){cout<<2;} };
class B:public A{