题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2024-05-31 05:30:43

[填空题]下面程序运行后输出的结果是 【12】 。 #include <iostream> using namespace std; class example{ const int m; public: example(int i):m(i){} void pr( ){cout<<"m="<<m<<endl’} }; int main( ){ example x(100); x.pr( ); return 0; }

更多"下面程序运行后输出的结果是 【12】 。 #include <io"的相关试题:

[填空题]下面程序运行后输出的结果是 【12】
#include <iostream>
using namespace std;
class example
const int m;
public:
example(int i):m(i)
void pr( )cout<<"m="<<m<<endl’
;
int main( )
example x(100);
x.pr( );
return 0;

[填空题]下面程序输出的结果是 【11】 。 #include <iostream> using namespacc std; class A { public: void show( ){tout<<"A!";} }; class B: public A{ public: virtual void show( ){cout<<"B!";} }; class C: public B{ public: virtual void show( ){cout<<"C!";} }; void show_info(A *i){i->show( );} void main( ){ A ia;B ib;C ic;show_info(&ia); show_info(&ib);show_info(&ic); }
[填空题]下面程序输出的结果是 【10】 。 #include <iostream> using namespace std; class A { public: virtual void show( ) {cout<<"A!"; }; class B: public A { public: void show( ) {cout << "B!";} }; class C: public B{ public: void show( ){cout << "C!";} }; void show_info(A &i) {i. show( );} void main( ) { A ia; B ib; C ic; show_info(ia);show_info(ib); show_info(ic); }
[填空题]以下程序运行后的输出结果是 【6】
#include<iostream>
using namespace std;
int main( )

int i=10,i:0;
do
j=j+i;
i--;
while(i>2);
cout<<j<<end1;
return 0;

[单项选择]下面的程序输出结果是( )。
#include<iostream>
using namespace std;
void add( )

static int x;
x++;
cout<<x<<’’;

int main( )

for(int i=0;i<3;i++)
add( );
return 0;

A. 111
B. 123
C. 222
D. 333
[单项选择]下面程序的输出结果是( )。
#include<iostream>
using namespace std;
void main( )

int a,b;
for(a=1,b=l;a<=100;a++)

if(b>=10) break;
if(b%3= =1)
b+=3;continue;

cout<<a;

A. 101
B. 6
C. 5
D. 4
[单项选择]下面程序的输出结果是( )。
#include <iostream>
using namespace std;
void main( )
inta[3][3] =1,2,3,4,5;
int s =0;
for(int i=1;i<3;i++)
for(int j=0;j<=i;j++) s+=a[i][j];
cout<<s<<endl;
A. 12
B. 4
C. 15
D. 13
[单项选择]下面程序的输出结果是( )。
#include<iostream>
Using namespace std:
Class Base
public:
Base(int x=0)count<<x;


Class Derived:public Base
public:Derved(int x=0count<<x;

private:
Base val;

int mina( )
Derived d(1);
return 0;

A. 0
B. 1
C. 01
D. 001
[填空题]下面程序的输出结果是 【8】 。 #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); funB(first,second); cout<<first<<" "<<second<<" "<<x<<endl; 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; }
[填空题]下面程序的输出结果是 【15】
#include<iostream>
using namespace std;
class base

protected:
int a;
public:
base( )cout<<"0":

class base1:virtual public base

public:
base1( )cout<<"1";

class base2:virtual public base

public
base2( )cout<<"2";

class derived:public base1,public base2

public:
derived( )cout<<"3";

int main( )

derived obj;
cout<<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;

[填空题]下面程序的输出结果是 【8】 。 #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) ; funB(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; }
[填空题]下面程序运行输出的结果是 【9】 。 #include <iostream> using namespace std; int main( ){ char a[]="Chinese"; a[3]=’/0’; cout<<a<<endl; return 0; }
[填空题]下面程序运行输出的结果是 【9】
#include <iostream>
using namespace std;
int main( )
char a[]="Chinese";
a[3]=’/0’;
cout<<a<<endl;
return 0;

我来回答:

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

订单号:

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