(26)在窗体上放置一个命令按钮Command1,并编写下列单击事件的程序: Private Option Base 1 Sub C
21 查阅
(26)在窗体上放置一个命令按钮Command1,并编写下列单击事件的程序: Private Option Base 1 Sub Command1_Click() Dim c As Integer,d As Integer d=0 c=6 X=Array(2,4,6,8,10,12) For i=1 To 6 IfX(i)>c Then d=d+X(i) c=X(i) Else d=d-c End If Next i Print d End Sub 程序运行后,单击命令按钮,则在窗体上输出的结果是 。A.10 B.12 C.16 D.20
参考答案: