题目内容 (请给出正确答案)
[主观题]

有如下程序: #include<iostream> using namespace std; class Complex { dou

ble 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)

提问人:网友xiaofeixia_1 发布时间:2022-01-06
参考答案
查看官方参考答案
如搜索结果不匹配,请 联系老师 获取答案
更多“有如下程序: #include<iostream> usin…”相关的问题
第1题
有如下程序:#include<iost earn>using namespace std;class TestClass{protected:TestClass(){co

有如下程序: #include<iost earn> using namespace std; class TestClass{ protected: TestClass(){cout<<'x';} TestClass(char C) {cout<<c;} }; class TestClass1:public TestClass { public: TestClass1(char C) {Cout<<c;) }; int main(){ TestClass1 d1('y'); return 0; } 执行这个程序,屏幕上将显示输出()。

A.y

B.yx

C.xy

D.yy

点击查看答案
第2题
若有以下程序:#include <iost ream>using namespace std;class A{private: int a;public: A(int

若有以下程序: #include <iost ream> using namespace std; class A { private: int a; public: A(int i) { a=i; } void disp () { cout<<a<<", "; } }; class B { private:

A.10,10,10

B.10,12,14

C.8,10,12

D.8,12,10

点击查看答案
第3题
有如下程序: #include #include usingnamespacestd; intmain()(cout$amp;A.***123***456

B.***123456***

C.***123456

D.123456

点击查看答案
第4题
有如下程序 #include <stdio.h>

B、98765

C、'9''8''7''6''5'

D、'43210'

点击查看答案
第5题
有如下程序 #include <stdio.h>

A.ABC

B.012

C.abc

D.123

点击查看答案
第6题
现有如下程序段,此程序段编译有错误,则程序段的错误出在include<stdio.h>main()这个语句
点击查看答案
第7题
有如下程序 #include <stdio.h>

A.MN

B.LK

C.OP

D.MM

点击查看答案
第8题
现有如下程序段,此程序段编译有错误,则程序段的错误出在 include main()这个语句
点击查看答案
第9题
有如下程序: #include<iostream> using namespace std; int main() { cout.f

有如下程序: #include<iostream> using namespace std; int main() { cout.fill('*') cout.width(6); cout.fill('#') cout<<123<<endl; return 0; } 执行后的输出结果是

A.###123

B.123###

C.***123

D.123***

点击查看答案
第10题
有如下程序: #include <iostream> #include <iomanip> using namespace std; int main() {cout.f

有如下程序: #include <iostream> #include <iomanip> using namespace std; int main() { cout.fill('*'); cout.width(6); cout.fill('#'); cout<<123<<end1; return 0; } 执行生的输出结果是()。

A. ###123

B.123###

C. ***123

D.123***

点击查看答案
第11题
有如下程序: #include<iomanip> #include<iostream> using namespace std; int main(){ cout<<se

有如下程序:

#include<iomanip>

#include<iostream>

using namespace std;

int main(){

cout<<setfill('*')<<setw(6)<<123<<456;

return 0;

}

运行时的输出结果是()。

A) ***123***456

B) ***123456***

C) ***123456

D) 123456

点击查看答案
账号:
你好,尊敬的用户
复制账号
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
欢迎分享答案

为鼓励登录用户提交答案,简答题每个月将会抽取一批参与作答的用户给予奖励,具体奖励活动请关注官方微信公众号:简答题

简答题官方微信公众号

警告:系统检测到您的账号存在安全风险

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

微信搜一搜
简答题
点击打开微信
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反简答题购买须知被冻结。您可在“简答题”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
微信搜一搜
简答题
点击打开微信