重要提示: 请勿将账号共享给其他人使用,违者账号将被封禁!
查看《购买须知》>>>
当前位置: 首页 > 职业技能鉴定 > 眼镜定配工
网友您好, 请在下方输入框内输入要搜索的题目:
搜题

题目

[主观题]

下面程序段的输出为#nclude"stdio.h"main(){printf("%d\n",12<<2);}A.0B.47C.48D.24

下面程序段的输出为 #nclude"stdio.h" main() { printf("%d\n",12<<2);}

A.0

B.47

C.48

D.24

查看参考答案
更多“下面程序段的输出为#nclude"stdio.h"main(){printf("%d\n",12<<2);}A.0B.47C.48D.24”相关的问题

第1题

有如下程序: #nclude<iostream> using namespace std; int main { void function(dou

有如下程序: #nclude<iostream> using namespace std; int main { void function(double val); double val; function(val); cout<<val; return 0; } void function(double val) } val=3;} 编译运行这个程序将出现的情况是()。

A.编译出错,无法运行

B.输出:3

C.输出:3.0

D.输出一个不确定的数

点击查看答案

第2题

有如下程序:nclude<iostream>using namespace std;class Animal{public:virtual char*getT

有如下程序:

nclude<iostream>

using namespace std;

class Animal{

public:

virtual char*getType()const{return“Animal”;}

virtual char*getVoice()const{return“Voice”;}

};

class Dog:public Animal{

public:

char*getType()const{rgturn“Dog”;}

char*getVoice()const{retum“Woof”;}

};

void type(Animal&A){cout<<a.getType();}

void speak(AnimalA){cout<<a.getVoice();}

int main(){

Dog d.type(D);tout<<“speak”;speak(D);cout<<endl;

return 0;

}

运行时的输出结果是【 】

点击查看答案

第3题

有如下程序: ﹟nclude<iostream> using namespace std; int main { int*P; *P=9: cou
t<<”The value at p:”<< *p; return 0; } 编译运行程序将出现的情况是()。

A.编译时出现语法错误,不能生成可执行文件

B.运行时一定输出:llle value at P:9

C.运行时一定输出:llle value at P:*9

D.运行时有可能出错

点击查看答案

第4题

有如下程序: #nclude<iostremn> using namespace std; class Stack{
public: Stack(unsigned n=10:size(n){rep_=new int[size];top=O;} Stack(Stack&s):size(s.size) { rep_=new int[size]; for(int i=0;i<size;i++)rep_[i]=s.rep_[i]; top=s.top; } ~Stack(){delete[]rep_;} void push(int a){rep_[top]=a; top++;} int opo(){--top;return rep_[top];} bool is Empty()const{return top==O;} pavate: int*rep_; unsigned size,top; }; int main() { Stack s1; for(int i=1;i<5;i++) s1.push(i); Stack s2(s1); for(i=1;i<3;i++) cout<<s2.pop()<<','; s2.push(6); s1.push(7); while(!s2.isEmpty()) cout<<s2.pop()<<','; return 0; } 执行上面程序的输出是

A.4,3,2,1

B.4,3,6,7,2,1

C.4,3,6,2,1

D.1,2,3,4

点击查看答案

第5题

有如下程序:#nclude <iostream>using namespace std;class Base{public:void fun1() {cout << "B

有如下程序:#nclude <iostream>using namespace std;class Base{ public:void fun1() {cout << "Base\n"; }virtual void fun2() {cout << "Base\n"; }};class Derived: public Base{ public:void fun1() {cout << "Derived\n"; }void fun2() {cout << "Derived\n"; }} void f(Base& b) { B. fun1(); B. fun2(); }int main(){Derived obj;f(obj);return 0;}

A.Base Base

B.Base Derived

C.Derived Base

D.Derived Derived

点击查看答案

第6题

下面程序的输出结果为【】。include <iostream>using namespace std;void initialize(int printNo,i

下面程序的输出结果为【 】。

include <iostream>

using namespace std;

void initialize(int printNo,int state=0);

void initialize(int printNo=1,int state);

int main()

{

initialize();

return 0;

}

void initialize(int printNo, int state)

{

cout<<printNo<<","<<state<<end1;

}

点击查看答案

第7题

有下面语句段,输出结果为_____。 using namespace std; #include <iostream> int main(){ char c = 'B'; switch (c) { case 'A':cout << "1"; case 'B':cout << "2"; case 'C':cout << "3"; default: cout << "4"; } return 0; }

A.2

B.23

C.234

D.编译错误

点击查看答案

第8题

有下面语句段,输出结果为_____。 using namespace std; #include <iostream> int main(){ char c = 'B'; switch (c) { case 'A':cout << "1"; case 'B':cout << "2"; case 'C':cout << "3"; default: cout << "4"; } return 0; }

A.2

B.23

C.234

D.编译错误

点击查看答案

第9题

若下面程序运行时输出结果为1,A,10.1 2,B,3.5 include <iostream> using namespace std; int mai

若下面程序运行时输出结果为

1,A,10.1

2,B,3.5

include <iostream>

using namespace std;

int main()

{

void test(int, char, doubie【 】);

test(1, 'A', 10.1 );

test(2, 'B');

return 0;

}

void test(int a, char b, double c)

{

cout<<a<<','<<b<<','<<c<<endl;

}

点击查看答案

第10题

13、有下面语句段,输出结果为_____。 using namespace std; #include <iostream> int main(){ char c = 'B'; switch (c) { case 'A':cout << "1"; case 'B':cout << "2"; case 'C':cout << "3"; default: cout << "4"; } return 0; }

A.2

B.23

C.234

D.编译错误

点击查看答案
赏学吧APP
TOP
重置密码
账号:
旧密码:
新密码:
确认密码:
确认修改
购买搜题卡查看答案
购买前请仔细阅读《购买须知》
请选择支付方式
微信支付
支付宝支付
点击支付即表示你同意并接受《服务协议》《购买须知》
立即支付
搜题卡使用说明

1. 搜题次数扣减规则:

功能 扣减规则
基础费
(查看答案)
加收费
(AI功能)
文字搜题、查看答案 1/每题 0/每次
语音搜题、查看答案 1/每题 2/每次
单题拍照识别、查看答案 1/每题 2/每次
整页拍照识别、查看答案 1/每题 5/每次

备注:网站、APP、小程序均支持文字搜题、查看答案;语音搜题、单题拍照识别、整页拍照识别仅APP、小程序支持。

2. 使用语音搜索、拍照搜索等AI功能需安装APP(或打开微信小程序)。

3. 搜题卡过期将作废,不支持退款,请在有效期内使用完毕。

请使用微信扫码支付(元)
订单号:
遇到问题请联系在线客服
请不要关闭本页面,支付完成后请点击【支付完成】按钮
遇到问题请联系在线客服
恭喜您,购买搜题卡成功 系统为您生成的账号密码如下:
重要提示: 请勿将账号共享给其他人使用,违者账号将被封禁。
发送账号到微信 保存账号查看答案
怕账号密码记不住?建议关注微信公众号绑定微信,开通微信扫码登录功能
警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“赏学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

- 微信扫码关注赏学吧 -
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反赏学吧购买须知被冻结。您可在“赏学吧”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
- 微信扫码关注赏学吧 -
请用微信扫码测试
温馨提示
每个试题只能免费做一次,如需多次做题,请购买搜题卡
立即购买
稍后再说
赏学吧