编写如下程序: Private Sub Command1_Click() Dim score As Integer score = 86 If score > 85 Then r = 1 ElseIf score >

admin2020-07-22  25

问题 编写如下程序:
Private Sub Command1_Click()
   Dim score As Integer
   score = 86
   If score > 85   Then
      r = 1
   ElseIf score > 60 Then
      r = 2
   Else
      r = 0
   End If
   Print r
End Sub
程序运行后,单击命令按钮Command1,输出结果为

选项 A、0
B、1
C、2
D、86

答案B

解析 考察If…Else If…Else…End If语句。条件判断成立则执行对应分支的语句。86>85,所以r=1。选B)。
转载请注明原文地址:https://jikaoti.com/ti/DhS0FFFM
0

随机试题
最新回复(0)