题目内容:
有如下程序: #inelude<iostream>
usingnamespacestd;
classTest
{
public:
Test(){n+=2;}
~Test(){n-=3;}
staticintgetNum(){returnn;}
private:
staticintn;
};
intTest::n=1;
intmain() Test*P=newTest:
deleteP;
cout<<"n="<<Test::getNum()<<endl;
return0;
}
执行后的输出结果是( )。 A.n=0
B.n=1
C.n=2
D.n=3
参考答案:
答案解析: