当前位置: 答题翼 > 问答 > 计算机类考试 > 正文
目录: 标题| 题干| 答案| 搜索| 相关
问题

有如下程序: #include<iostream> using namespace std; class Test { public


有如下程序: #include<iostream> using namespace std; class Test { public: Test(){n+=2;} ~Test(){n-=3;} static int getNum(){return n;} private: static int n; }; int Tesl::n=1 int main() { Test*p=new Test; delete p; cout<<"n="<<Tes::tgetNum()<<endl; return 0; } 执行后的输出结果是

A.n=0

B.n=1

C.n=2

D.n=3

参考答案
您可能感兴趣的试题
  • 有如下程序:include<iostream>using namespace std;Class A{public:A(){cout<<“A”;}~A(){cout<<

  • 有如下程序: #include<iostream> void fun(int&x,int y){int t=x;x=y;y=t;} int ma

  • 有如下程序: #include<iostream> using namespace std; class A { public:

  • 有如下程序: #include<iostream> using namespace std; class BASE { public

  • 有如下程序: #include<iostream> using namespace std; class AA { int n;

  • 有如下程序: #inClude<iostream> using namespaCe std; Class A{ publiC: statiC int a;