关闭→
当前位置:中文知识站>习题库>阅读下列程序:Readxifx<0  theny←elseifx>0  theny←elsey←0EndIfP...

阅读下列程序:Readxifx<0  theny←elseifx>0  theny←elsey←0EndIfP...

中文知识站 人气:2.11K

问题详情:

阅读下列程序:

Read x

if x<0   then y阅读下列程序:Readxifx<0  theny←elseifx>0  theny←elsey←0EndIfP...

else if x>0   then y阅读下列程序:Readxifx<0  theny←elseifx>0  theny←elsey←0EndIfP... 第2张

else y←0

End If

Print  y

如果输入x=-2,则输出结果y为(  )

(A)3+阅读下列程序:Readxifx<0  theny←elseifx>0  theny←elsey←0EndIfP... 第3张       (B)3-阅读下列程序:Readxifx<0  theny←elseifx>0  theny←elsey←0EndIfP... 第4张       (C)阅读下列程序:Readxifx<0  theny←elseifx>0  theny←elsey←0EndIfP... 第5张-5         (D)-阅读下列程序:Readxifx<0  theny←elseifx>0  theny←elsey←0EndIfP... 第6张-5

【回答】

B  

知识点:算法初步

题型:解答题

TAG标签:#elseifx #elsey #theny #Readxifx #0EndIfP #