在窗体上画一个名称为Command1的命令按钮,一个名称为Label11的标签。程序运行后,当单击命令按钮Command1

2025-01-01 02:59:13
推荐回答(1个)
回答1:

option base 1
Private sub command1_click()
Dim a(), n as integer, dcount as long
Do
N = inputbox("输入n")
Loop until n > 0
Redim a(n)
For I = 1 to n
A(I) = int(90*rnd+10)
If a(I) mod 2 = 0 then dcount=dcount+a(I)
Next
Label1.caption=dcount

希望对你有帮助。