单项选择题
有如下程序:
#include <iostream>
using namespace std;
class Test
public:
Test() n+=2;
~Test() n-=3;
static int getNum()retum n;
private:
static int n;
;
int Test:: n=1;
int main()
Test*p=new Test;
delete p;
cout<<"n="<<Test:: getNum()<<end1;
return 0;
;
执行后的输出结果是______.
A.n=0
B.n=1
C.n=2
D.n=3
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有如下程序: #include <iostream> using namespace std; class BASE public: ~BASE() cout<< BASE ; ; class DERIVED: public BASE public: ~DERIVED() cout<; DERIVED ; ; int main()DERIVED x; return 0; 执行后的输出结果是______ 。
A.BASE
B.DERIVED
C.BASEDERIVED
D.DERIVEDBASE
点击查看答案&解析
单项选择题
设有如下关系表: RST ______ ______ ______ A B C A B C A B C 1 1 2 3 1 3 1 1 2 2 2 3 2 2 3 3 1 3则下列操作中正确的是______ 。
A.T=R∩S
B.T=R∪S
C.T=R×S
D.T=R/S
点击查看答案&解析
相关试题
多数运算符既能作为类的成员函数重载,也能...
非成员函数应声明为类的 【10】 函数才...
下列程序的输出结果为: Object id=0 ...
下面是一个栈类的模板,其中push函数将元素...
派生类中的成员不以直接访问基类中的 【1...