首页 > 计算机等级考试
题目内容 (请给出正确答案)
[主观题]

有以下程序: #include<iostream>usingnamespaeestd; classMyClass{public: MyClass(intn){

有以下程序:

#include<iostream>

usingnamespaeestd;

classMyClass

{

public:

MyClass(intn){number=n;}

//拷贝构造函数

MyClass(MyClass&other){number=other.number;}

~MyClass(){}

private:

intnumber;

};

MyClassfun(MyClassp)

{

MyClasstemp(p);

returntemp;

}

intmain()

{

MyCIassobj1(10),obj2(O);

MyClassobj3(obj1);

obj2=fun(obj3);

return0;

程序执行时,MyClass类的拷贝构造函数被调用的次数是()。

A.5

B.4

C.3

D.2

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“有以下程序: #include<iostream>using…”相关的问题
第1题
有以下程序()

A.#include

B.02356

C.0235

D.235

E.2356

点击查看答案
第2题
有以下程序:#include<iostream.h>#include<iomanip.h>void main(){cout.fill('*');cout.width(10

有以下程序: #include<iostream.h> #include<iomanip.h> void main() { cout.fill('*'); cout.width(10); cout,<setiosflags(ios::left)<<123.45<<endl; } 程序执行后的输出结果是()

A.****123.45

B.**123.45**

C.123.45****

D.***123.45*

点击查看答案
第3题
有以下程序()

A.#include

B.abcdef

C.ABCDEF

D.aBcDeF

E.AbCdEf

点击查看答案
第4题
有以下程序:#include程序运行后的输出结果是()。A)26 B)19 C)10 D)20

有以下程序:

#include

有以下程序:#include程序运行后的输出结果是()。A)26 B)19 C)10 D)20有以下

程序运行后的输出结果是()。

A)26

B)19

C)10

D)20

点击查看答案
第5题
有以下程序#include <stdio.h>#include <string.h>main(){ printf("%d\n",strlen (

有以下程序

#include <stdio.h>

#include <string.h>

main()

{ printf("%d\n",strlen ("ATS\n012\1") ); }

程序运行后的输出结果是

A)3

B)8

C)4

D)9

点击查看答案
第6题
有以下程序#include<stdio.h>#include<string.h>main(){char a[10]=”abcd”;prinff(“

有以下程序

#include<stdio.h>

#include<string.h>

main()

{char a[10]=”abcd”;

prinff(“%d,%d\n”,strlen(A),sizeof(A));

}

程序运行后的输出结果是

A.7,4

B.4,10

C.8,8

D.10,lO

点击查看答案
第7题
有以下程序:include<stdio.h>include<strin9.h>main(){printf{"%d\n",s

有以下程序:

include<stdio.h>

include<strin9.h>

main()

{printf{"%d\n",strlen("%d\n",strlen("ATS\n012\|"));}

程序运行后的输出结果是()。

A.3

B.8

C.4

D.9

点击查看答案
第8题
有以下程序:#include <iostream>#include <string>using namespace std;int main (){ char s[]="

有以下程序: #include <iostream> #include <string> using namespace std; int main () { char s[]="\n123\\"; cout<<strlen (s) <<", "<<sizeof (s) <<end1; return 0; }

A.赋初值的字符串有错

B.6,7

C.5,6

D.6,6

点击查看答案
第9题
有以下程序:#include<stdio.h>#include<string.h>main(){char str[][20]={"Hello","Beijing"},*P

有以下程序: #include <stdio.h> #include <string.h> main() { char str[][20]={"Hello","Beijing"},*P=str[0]; printf("%d\n",strlen(p+20)); } 程序运行后的输出结果是()。

A.0

B.5

C.7

D.20

点击查看答案
第10题
有以下程序#include<stdio.h>void fun(char**p){++p;printf("%s",*p);}main{cha

有以下程序

#include<stdio.h>

void fun(char**p)

{++p;printf("%s",*p);}

main

{char*a[]={"Morning","Afternoon","Evening"," Night");

fun(a);

}

程序的运行结果是()。

A.Afternoon

B.fternoon

C.Morning

D.orning

点击查看答案
第11题
有以下程序#include<stdio.h>#include<string.h>main(){char x[]=“STRING”;x[0]=0;

有以下程序

#include<stdio.h>

#include<string.h>

main()

{char x[]=“STRING”;

x[0]=0;x[1]=’\0’;x[2]=’0’;

printf(”%d%d\n”,sizeof(x),strlen(x));

}

程序运行后的输出结果是()。

A.6 1

B.7 0

C.6 3

D.7 1

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改