有如下程序:
#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;
;
执行后的输出结果是______.
题库:计算机等级考试
类型:最佳选择题
时间:2017-07-03 15:36:17
免费下载:《单项选择》Word试卷
有如下程序:
#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
本题关键词:程序,有序镜检,工程施工程序,复苏程序,工作程序,建设程序,程序变更,程序冲突,点火程序,生产程序;