问题
填空题
下列程序的输出结果是 【11】 。
#include<iostream>
using namespace std;
class Test
public:
Test()cnt++;)
~Test()cnt--;)
static int Count()retum cnt;
private:
static int cnt;
;
int Test::cnt=0;
int main()
cout<<Test::Count()<<’’;
Test t1,t2;
Test*pT3=new Test;
Test*p T4=new Test;
cout<<Test::Count()<<’’;
delete pT4;
delete pT3;
cout<<Test::Count()<<endl;
return0;
答案
参考答案:042