试题查看

首页 > 计算机二级考试 > 试题查看
【单选题】

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

A、n=0
B.n=l
C.n=2
D.n=3
查看答案解析

参考答案:

正在加载...

答案解析

正在加载...

根据网考网移动考试中心的统计,该试题:

79%的考友选择了A选项

16%的考友选择了B选项

2%的考友选择了C选项

3%的考友选择了D选项

你可能感兴趣的试题

使用VC++6.0打开考生文件夹下的源程序文件2.cpp。阅读下列函数说明和代码若有以下程序:#include<iostream>usingnamespaces以下程序的正确运行结果是()。#include<iostream.h>intf(下列程序的运行结果是#inClUde<iostream.h>classLocat有以下程序intf1(intx,inty)returnx>yx:y;intf2(列出工资表中基本工资在1200元~1800元之间的职工信息,应使用的SQL查询语