当前位置:中文谷 >

习题库

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

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

问题详情:

阅读下列程序:

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  

知识点:算法初步

题型:解答题

  • 文章版权属于文章作者所有,转载请注明 https://zhongwengu.com/exercises/m922l8.html
最新文章