1. 写出单击窗体的运行结果
Private Sub Form_Click()
For I=1 To 5
Print Tab(11-I);
For J=1 To I*2-1
Print “*”;
Next
Print
Next I
End Sub
2. 写出单击窗体的运行结果
Option Base 1
Private Sub Form_Click()
Dim a(5, 5) As Integer
Dim i As Integer, j As Integer
For i = 1 To 5
For j = 1 To 5
If j <= i Then
a(i, j) = 1
End If
Print a(i, j); " ";
Next j
Print
Next i
End Sub
3. 程序运行时,连续二次单击窗体后,写出屏幕上显示的结果:
Dim x As Integer
Private Sub Form_Load()
x = 2
End Sub
Private Sub Form_Click()
Static a As Integer
Dim b As Integer,y As Integer
b = x ^ 2
abc x, b
a =a+ x
y=y+b
Print a, b, x,y
End Sub
Sub abc(ByRef y As Integer, ByVal z As Integer)
y = y + z
z = y - z