有如下程序: include<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

时间:2023-10-04 09:23:07

相似题目