题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2024-02-07 00:27:24

[单项选择]如下程序运行时的输出结果是
#include<iostream>
using namespace std;
class ONE
int c;
public:
ONE( ):c(0)eout<<1;
ONE(int n):C(n)cout<<2;

class TW0
ONE onel;
ONE one2;
public:
TWO(int m):one2(m)eout<<3;

int main( )
TWO t(4);
return 0;

A. 3
B. 23
C. 123
D. 213

更多"如下程序运行时的输出结果是 #include<iostream> "的相关试题:

[单项选择]下面程序输出的结果是( )。 #include<iostream> using namespace std; int test(int n1,int n2) {return n1 +n2;} float test (int f1,float f2){return f1-f2;} float test(float x,float y){return(x+y)/2;} float test(float x,int y){return(x+y)*2;} void main( ){ int a1=10; float a2=2.5f; cout<<test(a1,a2); }
A. 12.5
B. 7.5
C. 6.25
D. 25
[单项选择]下面程序的输出结果是( )。
#include<iostream>
using namespace std;
void main( )
int i=1;
while(i<=8)
if(++i%3!=2)continue;
else cout<<i;

A. 369
B. 258
C. 36
D. 25
[单项选择]以下程序的输出结果是( )。
#include<iostream>
using namespace std;
void fun(char**q)

++q;
cout<<*q<<end1;

main( )
static char* s []= "HI","HELLO","TEST";
char**p;
p=s;
fun(p);
system("PAUSE");
return 0;
A. 为空
B. HI C) HELLO D) TEST
[单项选择]下列程序的输出结果是( )。
#include<iostream>
using namespace std;
template<typename T>
T fun(T a,T b) return(a<=b)a:b;
int main( )

cout<<fun(3,6)<<','<<fun(3.14F,6.28F)<<end1;
return ( );

A. 0,3.14
B. 3,3.14
C. 3,3
D. 3.14,3.14
[单项选择]下面程序的运行结果是( )。
#include<iostream>
using namespace std;
class TestClass

static int n;
public:
TestClass ( )

n++;

static int test( )

for(int i=0;i<4;i++)
n++;
return n;

;
int TestClass::n=0;
int main( )

cout<<TestClass::test( )<<" ";
TestClass c1,c2;
cout<<TestClass::test( )<<endl;
return ( );

A. 4,10
B. 4,6
C. 0,6
D. 0,4
[填空题]

下列程序的输出结果是 【15】
#include<iostream>
using namespace std;
class base{
public:
int n;
base (int x){n=x;}
virtual void set (int m){n=m;cout<<n<<’’;}
};
class deriveA:public base{
public:
dericeA(int x):base(x){}
void set(int m){n+m;cout<<n<<’’;}
};
Class deriveB:public base{
public:
deriveB(int x):base(x){}
void set(int m){n+m;cout<<n<<’’;}
};
int main( )
{
deriveA d1(1);
deriveB.d2(3);
base*pbase;
pbase=&d1;
pbase->set(1);
pbase=&d2;
pbase->set(2);
return 0;
}


[单项选择]下面程序的运行结果为( )。
#include<iostream>
using namespace std;
void main( )
int a=1;
switch(a)
case 1:cout<<"1";
case 2:cout<<"2";
break;
default:cout<<"0";


A. 12
B. 120
C. 1
D. 10
[单项选择]有以下程序,输出结果( )。
#include<iostream>
using namespace std;
class Complex

public:
Complex(double r=0,double i=0):re(r),im(i)
double real( )constreturn re;
double imag( )const return im;
Complex operator+(Complex c)constreturn
Complex(re+c.re,im+c.im);
private:
double re,ira;
;
int main( )

Complex a =Complex(1,1)+Complex(5);
cout<<a.real( )<<'+'<<a.imag( )<<'i'<<end1;
return ( );

A. 6+i
B. 2i+5 C) 6+1i D) 1i+5
[填空题]在下面横线上填上适当的语句,完成程序。
#include<iostream>
using namespace std;
class Base int x;
public:
Base(int i) x=i;
~Base( )
;
class Derived: public Basepublic:
【14】 //完成类Derive 构造函数的定义
;
int main( ) Derived Obj( );
return 0;

我来回答:

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

订单号:

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