文语站

位置:首页 > 习题库 > 

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

习题库5.88K

问题详情:

阅读下列程序:

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  

知识点:算法初步

题型:解答题