填空题

下列程序的输出结果是______。
#include<iostream>
using namespace std;
int main()

int data=l;
int &r = data;
data+=5;
r+=5;
cout<<data<<endl;
return 0;

【参考答案】

K
<上一题 目录 下一题>
热门 试题

填空题
下列程序的输出结果是______。 #include<iostream> using namespace std; class Test public: Test() cnt++; ~Test() cnt--; static int Count() return cnt; private: static int cnt; ; int Test::cnt=0; int main() cout<<Test::Count()<<’’; Test t1,t2; Test*oT3=new Test; Test*pT4=new Test; cout<<Test::Count()<<’’; delete pT4; delete pT3; cout<<Test::Count()<<endl; return 0;
填空题
下面程序的运行结果是______。 #include<iostream> using namespace std; class count static int n; public: count() n++; static int test() for(int i=0;i<4;i++) n++; return n; ; int count::n=0; int main() cout<<count:: test()<< ; count c1, c2; cout<<count :: test()<<endl; return 0;
相关试题
  • 下面程序的执行结果是______。 #in...
  • 有以下程序: #include<iostream> usi...
  • Staff类含有血型数据成员ID,两个Staff对象...
  • 虚函数必须是类的______。