题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2024-05-22 06:42:28

[填空题]下列程序的输出结果是______。
#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<iostrea"的相关试题:

[单项选择]下列程序的输出结果是()
#include <iostream>
using namespace std;
int main ( )

char a[] = "Hello,World":
char*ptr = a;
while (*ptr)

if(*ptr>= 'a' &&*ptr <='z'
cout<<char*ptr+'A'-'a');
else cout<<*ptr;
ptr++;

return 0;
A. HELLO. WORLD
B. Hello, World
C. hELLO, wORLD
D. hello, world
[填空题]下列程序的输出结果是 【14】
#include<iOStream>
using namespace std;
template <typename T>
T total (T*datA)

T s=0;
while(*datA)

s+=*data++;

return s;

int main( )

int x[]=2,4,6,8,0,12,14,16,18;
cout<<total(x)<<end1;
return 0;

[填空题]下列程序的输出结果是 【8】 #include<iostream> using namespace std; int main( ) { int Bum=500; int& ref=num; ref+=100; cout<<num<<end1; return 0; }
[填空题]下列程序的输出结果是 【10】
#include<iostream>
using nameSpace std;
int main( )

int data=1;
int &r=data;
data+=5;
r+=5;
cout<<data<<end1;
return 0;

[填空题]以下程序的输出结果是 【6】
#include <iostream>
using namespace std;
int main( )

int s,i;
for(s=0,i=1;i<3;i++)
s+=i;
cout<<s<<end1;
return 0;

[填空题]下面程序的输出结果是 【8】
#include <iostream>
using namespace std;
int d=1;
fun(int p)
static int d = 5;
d+ =p;
cout<<d;
return (d) ;

void main ( )
int a =3;
cout<<fun ( a + fun (d) )<<endl;

[填空题]下列程序的输出结果是 【10】
#include<iostream>
using namespace std;
void fun (int &rf)

rf*=2;

int main( )

int num:500;
fun(num);
cout<<num<<endl;
return 0;

[填空题]下列程序的输出结果是 【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; }
[填空题]执行这个程序的输出结果是( );
#include<iostream>
using namespace std;
class TestClass1

public:
void fun1( )cout<<"TestClass1/n";
virtual void fun2( )cout<<"TestClass1/n";
;
class TestClass2:public TestClass1

public:
void fun1( )cout<<"TestClass2/n";
void fun2( )cout<<"TestClass2/n";
;
void f(TestClass1&b)b.fun1( );b.fun2( );
int main( )

TestClass2 obj;
f(obj);
return 0;

[填空题]下面程序的输出结果是______。
#include<iostream>
using namespace std;
int x;
void funA(int&,int);
void funB(int,int&);
int main( )

int first;
int second=5;
x=6;
funA(first,seconD) ;
fimB(first,seconD) ;
cout<<first<<" "<<second<<" "<<x<<end1;
return 0;

void funA(int &a,int B)

int first;
first=a+b;
a=2*b;
b=first+4;

void funB(int u,int &v)

int second;
second=x;
v=second+4;
x=u+v;

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码