全部题库 / VB / 试题详情
单选题 VB
2008-03-22

在窗体上画一个名称为Command1的命令按钮,然后编写如下代码:
Option Base 1
Private Sub Command1_Click()
 d = 0
 c = 10
 x = Array(10, 12, 21, 32, 24)
  For i = 1 To 5
   If x(i) > c Then
  d = d + x(i)
  c = x(i)
 Else
  d = d-c
 End If
Next i
 Print d
End Sub
程序运行后,如果单击命令按钮,则在窗体上输出的内容为(  )。

A.89
B.99
C.23
D.77

参考答案

C

答案解析

暂无解析

你可能感兴趣的试题

A.Private Sub Command1_Click()
   Label3.Caption = Str(Val(Label1.Caption )*Val( Label2.Caption))
  End Sub
B.Private Sub Command1_Click()
   Label3.Caption = HScroll1.Value * HScroll2.Value
  End Sub
C.Private Sub Command1_Click()
   Label3.Caption = HScroll1 * HScroll2
  End Sub
D.Private Sub Command1_Click()
   Label3.Caption = HScroll1. Text * HScroll2.Text
  End Sub