重要提示: 请勿将账号共享给其他人使用,违者账号将被封禁!
查看《购买须知》>>>
找答案首页 > 全部分类 > 求职面试
搜题
网友您好, 请在下方输入框内输入要搜索的题目:
搜题
题目内容 (请给出正确答案)
[主观题]

1)#include 2)# include 3)using namespace std;4)dou...

1)#include< iostream >

2)# include< math.h >

3)using namespace std;

4)double max(double x,doubley);

5)void main()

6){

7)double   a,b,c;

8)cout<< " input two numbers:"; 9)cin>>a>>b;

10)c=max(a,b);

11)cout<< " the squart of max imum="<< sqrt(c); 12)} 13)double max(doublex,doubley) 14){ 15)if(x>y)

16)returnx;

17)else

18)returny;

19)}

执行完第7行后,a的值是:()

A. 0

B. 1

C. 变量不存在

D. 随机值

查看答案
更多“1)#include 2)# include 3)using namespace std;4)dou...”相关的问题

第1题

1)#include < iostream >2)#include < cmath >3)using namespace std;4)double ma
1)#include< iostream >

2)#include< cmath >

3)using namespace std;

4)double max(double x,doubley)

5){

6)if(x>y)

7)return x;

8)else

9)return y;

10)}

11)int main()

12){

13)doublea,b,c;

14)cout<<" input two numbers:\n";

15)cin >>a >>b;

16)c=max(a,b);

17)cout<<" the squart of max imum="<< sqrt( c );

18)}

第13行中变量a、b、c的类型是:()

A.整型

B.单精度浮点型

C.双精度浮点型

D.字符型

点击查看答案

第2题

1)#include

2)#include

3)usingnamespacestd;

4)doublemax(doublex,doubley);

5)voidmain()

6){

7)double a,b,c;

8)cout<<"inputtwonumbers:\n";

9)cin>>a>>b;

10)c=max(a,b);

11)cout<<"thesquartofmaximum="< 12)}

13)doublemax(doublex,doubley)

14){

15)if(x>y)

16)returnx;

17)else

18)returny;

19)}

程序第11行中sqrt( c )的作用是:()

A、求c的绝对值

B、求c的平方

C、求c的开平方

D、将c进行类型转换

点击查看答案

第3题

有如下程序: #include<iostream> using namespace std; class Complex { double re, im; public: Complex(double r, double i): re(r), im(i) {} double real() const { return re; } double image() const { return im; } Complex& operator+= (Complex a) { re += a.re; im += a.im; return *this; } }; ostream& operator<<(ostream& s, const Complex& z) { remm s<<'('<<z.real()<<','<<z.image()<<')'; } int main() { Complex x(1,-2), y(2,3); cout<<(x+=y)<<endl; return 0; } 执行这个程序的输出结果是

A.(1,-2)

B.(2,3)

C.(3,5)

D.(3,1)

点击查看答案

第4题

有如下程序: #include<iostream> using namespace std; class Complex { double re, im; public: Complex(double r, double i): re(r), im(i) {} double real() const { return re; } double image() const { return im; } Complex& operator+= (Complex a) { re += a.re; im += a.im; return *this; } }; ostream& operator<<(ostream& s, const Complex& z) { remm s<<'('<<z.real()<<','<<z.image()<<')'; } int main() { Complex x(1,-2), y(2,3); cout<<(x+=y)<<endl; return 0; } 执行这个程序的输出结果是

A.(1,-2)

B.(2,3)

C.(3,5)

D.(3,1)

点击查看答案

第5题

有以下程序: #include <iostream> #include <string> using namespace std; int main ( ) { char b1[8] = "abcdefg"; char b2[8],*pb=b1+3; while (--pb>=b1) strcpy (b2, Pb) ; cout<<strlen (b2) <<end1; return 0; } 程序运行后的输出结果是( )。

A.8

B.3

C.1

D.7

点击查看答案

第6题

1)#include2)using namespace std;3)int main()4){5)int a,b,result;6)cout<<"p
1)#include

2)using namespace std;

3)int main()

4){

5)int a,b,result;

6)cout<<"please input two numbers:\n";

7)cin>>a>>b;

8)result=3*a-2*b+1;

9)cout<<"resultis"<< result<< endl;

10)}

程序的第5行中的cout表示:()

A、显示字符串

B、标准输出的流设备

C、标准输入的流设备

D、程序入口

点击查看答案

第7题

有以下程序: #include<iostream> #include<string> using namespace std; int main() { char arr[2][4]; strcpy(arr[0],"you"); strcpy(arr[1],"me"); arr[0][3]='&'; cout<<arr[0]<<end1; return 0; } 执行后的输出结果是( )。

A.you&me

B.you

C.me

D.err

点击查看答案

第8题

1)#include2)usingnamespacestd;3)intmain()4){5)inta,b,result;6)cout<<"pleasein
1)#include

2)usingnamespacestd;

3)intmain()

4){

5)inta,b,result;

6)cout<<"pleaseinputtwonumbers:\n";

7)cin>>a>>b;

8)result=3*a-2*b+1;

9)cout<<"resultis"< 10)}

若在第7行时输入“4空格3单击回车”,则程序第8行执行完后,result的值是:()

A.7

B.15

C.19

D.24

点击查看答案

第9题

若有以下程序: #include <iostream> using namespace std; int main() { int a[4] [4] = {{1,2,3,-4},{0,-12,-13,14}, {-21,23,0,-24},{-31,32,-33,0}}; int i,j,s = 0; for(i=0;i<4;i++) { for(j=O;j<4;j++) { if(a[i] [j] >=0) continue; s+=a [i] [j]; } } cout<<s<<end1; return 0; } 执行后的输出结果是( )。

A.-138

B.141

C.75

D.-1

点击查看答案

第10题

有如下程序:

#include

using namespace std;

class Complex

{

double re, im;

public:

Complex(double r, double i):re(r), im(i){}

double real() const{return re;}

double image() const{return im;}

Complex& operator +=(Complex a)

{

re += a.re;

im += a.im;

return *this;

}

};

ostream &operator<<(ostream& s,const Complex& z)

{

return s<<'('<

}

int main()

{

Complex x(1, -2), y(2, 3);

cout<<(x += y)<

return 0;

}

执行这个程序的输出结果是

A . (1, -2)

B . (2, 3)

C . (3, 5)

D . (3, 1)

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

1. 搜题次数扣减规则:

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

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

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

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

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

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

- 微信扫码关注上学吧 -
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反上学吧购买须知被冻结。您可在“上学吧”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
- 微信扫码关注上学吧 -
请用微信扫码测试
选择优惠券
确认选择
谢谢您的反馈

您认为本题答案有误,我们将认真、仔细核查,如果您知道正确答案,欢迎您来纠错

上学吧找答案