網站首頁 練習題 成語大全 造句 名詞解釋 經典語錄 名人語錄
當前位置:國文精選館 > 練習題 > 

閱讀下列程序:Readxifx<0  theny←elseifx>0  theny←elsey←0EndIfP...

欄目: 練習題 / 發佈於: / 人氣:4.63K

問題詳情:

閱讀下列程序:

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  

知識點:算法初步

題型:解答題