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

以下程序的输出结果是()。#include<iostream>#include<stdlib>using namespace std;void func(cha

以下程序的输出结果是()。 #include<iostream> #include<stdlib> using namespace std; void func(char **m) { ++m; cout<<*m<<endl; } main() { static char *a[]={"MORNING","AFTERNOON","EVENING"); char **n; n=a; func(n); system("PAUSE"); return 0; }

A.为空

B.MORNING

C.AFTERNOON

D.EVENING

提问人:网友xlimof 发布时间:2022-01-07
参考答案
查看官方参考答案
如搜索结果不匹配,请 联系老师 获取答案
更多“以下程序的输出结果是()。#include<iostream…”相关的问题
第1题
以下程序的执行结果是【 】。

include<iostream.h>

include<stdlib.h>

class Sample

{

public:

int x,y;

Sample(){x=y=0;}

Sample(int a,int b) {x=a;y=b; }

void disp()

{

cout<<"x="<<x<<",y="<<y<<end1;

}

};

void main() {

Sample s1(2,3);

s1.disp();

}

点击查看答案
第2题
有以下程序:

include <iostream.h>

include <fstream.h>

include <stdlib.h>

int main()

{

fstream filel,file2;

char line[100];

filel.open("source.txt",ios::in);

if(!file1)

{

cout<<"Can't open file source.txt!"<<end1;

abort();

}

file2.open("dest.txt",ios::out);

if(!file2)

{

cout<<"Can't open file dest.txt!"<<end1;

abort();

}

while(!file1.eof())

{

filel.getline(1ine,100);

file2<<line;

file2<<end1;

}

filel.close();

file2.close();

return 0;

}

此程序实现的功能是【 】。

点击查看答案
第3题
下列程序的执行结果是()。 #include #include classTestClass { public: intX,y; TestClass(){x=y=0;} TestClass(inta,intb)(x=a;y=b;}voiddisp() { cout$amp;A.x=2,y=2

B.x=2,y=3

C.x=3,y=2

D.x=3,y=3

点击查看答案
第4题
写出下列程序的运行结果【 】。

include <iostream.h>.

include <fstream.h>

include <stdlib.h>

void main()

{

fstream outfile, infile;

outfile.open("data.clat", ios:: out);

if(!outfile)

{

cout<<"Can't open the file."<<end1;

abort();

}

outfile<<" 1234567890"<<end1;

outfile<<"aaaaaaaaa"<<end1;

outfile<<"**********"<<end1;

outfile.close();

infile.open("data. dat ", ios:: in);

if(!infile)

{

cout<<"Can't open the file."<<end1;

abort();

}

char line[80];

int I=0;

while(!infile. eof())

{

I++;

infile.getline(line, sizeof(line));

cout<<I<<":"<<line<<end1;

}

infile.close();

}

点击查看答案
第5题
设有说明:char s1[10],*s2=s1;则以下正确的语句是 。

A、s1[]="computer"

B、s1[10]="computer"

C、s2="computer"

D、*s2="computer"

点击查看答案
第6题
下列程序的执行结果是()。 #include(iostream.h> #include classTestClass { public: intX,y; TestClass(){x=y=0;} TestClass(inta,intb){x=a;y=b;} voiddisp() { cout$amp;A.x=2,y=2

B.x=2,y=3

C.x=3,y=2

D.x=3,y=3

点击查看答案
第7题
有以下程序

#include

#include

main()

{int*a,*b,*c;

a=b=c=(int*)malloc(sizeof(int));

*a=1;*b=2,*c=3;

a=b

printf(”%d,%d,%d\n”,*a,*b,*c);

}

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

A.3,3,3

B.2,2,3

C.1,2,3

D.1,1,3

点击查看答案
第8题
以下程序的执行结果是 #include <stdio.h> int main() { int a = 5, b = 4, x, y; x = 2 * a++; y = --b * 2; printf("a=%d, x=%d\n", a, x); printf("b=%d, y=%d\n", b, y); return 0; }

A、a=6, x=10 b=3, y=6

B、a=6, x=10 b=3, y=8

C、a=6, x=12 b=3, y=6

D、以上均不对

点击查看答案
第9题
下列程序的输出结果是()。

#included

usingnamespacestd;

intmain()

{

chara[]="Hell0,Test";

char*p=a;

while(*p)

{

if(*p>='a'&&*p<='z')

cout$amp;elsecout$amp;p++;

}

return0;

}

A.hello,test

B.Hello,Test

C.HELLO,TEST

D.hELLO,tEST

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

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

简答题官方微信公众号

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

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

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