搜题
网友您好,请在下方输入框内输入要搜索的题目:
搜题
题目内容 (请给出正确答案)
提问人:网友zzsufo 发布时间:2022-01-07
[主观题]

有如下程序:#include<iostream>#include<iomanip>using namespace std;int main(){i

有如下程序:

#include<iostream>

#include<iomanip>

using namespace std;

int main(){

int S[]={123,234};

cout<<right<<setfill(‘*’)<<setw(6);

for(int i=0;i<2;i++){cout<<s[i]<<endl;}

retum 0;

}

运行时的输出结果是

A.123

B.***123

C.***123

D.***123 234 234 ***234 234***

简答题官方参考答案 (由简答题聘请的专业题库老师提供的解答)
查看官方参考答案
更多“有如下程序:#include<iostream>#include<iomanip>using namespace std;int main(){i”相关的问题
第1题
有如下程序   #include <iostream>   #include <iomanip>   using namespace std;   class MyClass{   public:    MyClass(){cout<<’a';}    myclass(char c   };   void main(){ myclass p1,*p2; p2="new" myclass('x’); delete p2;}  执行这个程序幕上将显示输出(> A、ABX

B、ABXB

C、AXB

D、AXBB

点击查看答案
第2题
运行程序,程序输出结果是( )。 #include <iostream> using namespace std; int main() { struct stud { char num [5]; int s[4]; double ave; } a; cout< <sizeof(stud)> < <endl; return 0;> A、29

B、30

C、31

D、32

点击查看答案
第3题
有如下程序: #include #includediomanip> usingnamespacestd; intmain(){ ints[]={123,234); cout$amp;A.123

B.***123 234234

C.***123

D.***123 ***234234***

点击查看答案
第4题

如下程序的输出是什么____ #include <iostream> #include <exception> using namespace std; struct MyException : public exception { const char * what () const throw () { return "C++ Exception"; } }; int main() { try { throw MyException(); } catch(MyException& e) { std::cout << "MyException" << std::endl; } catch(std::exception& e) { std::cout<<"exception" std::endl; }>

点击查看答案
第5题
下列程序的执行结果是() #include <iostream.h> #include <string.h> class ABC { char *str; int max_len; public: ABC(int i, char *s); ~ABC(); }; ABC::ABC(int i, char *s) { max_len=i+1; str=new char[max_len]; strcpy(str, s); } ABC::~ABC() { cout< <str; delete str; } void main() { char *ss="\nHello, C++ !" ; abc sd(strlen(ss), ss); end.";> A、Main end.

B、Hello, C++ !

C、Main end. Hello, C++ !

D、Hello, C++ ! Main end.

点击查看答案
第6题
阅读以下程序,给出运行结果 #include <iostream> #include <cstring> using namespace std; int main() { string str="I love China!"; cout << str; return 0; }
点击查看答案
第7题

调试程序,写出程序的输出结果,并解释 #include <iostream> #include <iostream> using namespace std; class complex { public: complex() { real = imag = 0.0; } complex(double r) { real = r; imag = 0.0; } complex(double r, double i) { real = r; imag = i; } friend complex operator + (const complex &c1, const complex &c2); friend complex operator - (const complex &c1, const complex &c2); friend complex operator * (const complex &c1, const complex &c2); friend complex operator / (const complex &c1, const complex &c2); friend void print(const complex &c); private: double real, imag; }; complex operator+ (const complex &c1, const complex &c2) { return complex(c1.real + c2.real, c1.imag + c2.imag); } complex operator-(const complex &c1, const complex &c2) { return complex(c1.real - c2.real, c1.imag - c2.imag); } complex operator * (const complex &c1, const complex &c2) { return complex(c1.real*c2.real - c1.imag * c2.imag, c1.real*c2.imag + c1.imag * c2.real); } complex operator/(const complex &c1, const complex &c2) { return complex((c1.real*c2.real + c1.imag * c2.imag) / (c2.real*c2.real) / (c2.real*c2.real + c2.imag*c2.imag), (c1.imag*c2.real - c1.real * c2.imag) / (c2.real)*(c2.real + c2.imag*c2.imag)); } void print(const complex &c) { if (c.imag < 0) cout << c.real << c.imag << "i"; else cout << c.real << "+" << c.imag << "i"; } int main() { complex c1(2.0), c2(3.0, -1.0), c3; c3 = c1 + c2; cout << "\ncl+c2="; print(c3); c3 = c1 - c2; cout << "\nc1-c2="; print(c3); c3 = c1 * c2; cout << "\ncl*c2="; print(c3); c3 = c1 / c2; cout << "\nc1/c2="; print(c3); c3 = (c1 + c2)*(c1 - c2) * c2 / c1; cout << "\n(c1 + c2)*(c1 - c2) * c2 / c1="; print(c3); cout << endl; return 0; }

点击查看答案
第8题
有如下程序:#include<iostream>#include<cstring>using namespace std;class XCF{in
有如下程序:

#include<iostream>

#include<cstring>

using namespace std;

class XCF{

int a;

public:

XCF(int aa=O):a(aA){cout<<”1”;}

XCF(XCF&X){a=x.a;cout<<”2”;}

~XCF(){cout<<at}

int Geta(){return at}

};

int main(){

XCF dl(5),d2(d1);

XCF半pd=new XCF(8);

cout<<pd->Geta();

delete pd;

return 0;

}

运行时的输出结果是

A.1215588

B.1218855

C.12185

D.128512

点击查看答案
第9题
有如下程序,则其输出结果为( )。 #include <stdio.h> void main() { void fun(int n); int n=2019; fun(n); } void fun(int n) { x=0; while(n!=0) { x=x*10+n%10; n=n/10; } printf("%d\n",x); }

A、2019

B、9102

C、20

D、19

点击查看答案
重要提示: 请勿将账号共享给其他人使用,违者账号将被封禁!
查看《购买须知》>>>
重置密码
账号:
旧密码:
新密码:
确认密码:
确认修改
购买搜题卡查看答案
购买前请仔细阅读《购买须知》
请选择支付方式
微信支付
支付宝支付
点击支付即表示你同意并接受《服务协议》《购买须知》
立即支付
搜题卡使用说明

1. 搜题次数扣减规则:

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

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

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

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

请使用微信扫码支付(元)

订单号:

遇到问题请联系在线客服

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

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

- 微信扫码关注简答题 -
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反简答题购买须知被冻结。您可在“简答题”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
- 微信扫码关注简答题 -
请用微信扫码测试
欢迎分享答案

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

简答题官方微信公众号

简答题
下载APP
关注公众号
TOP