一、 写出程序的执行结果
1、 阅读下面的事件过程。单击窗体后,在文本框Text1和Text2中显示的内容分别是什么?
Provate Sub Form_Click()
Dim x As Integer, y As Integer
X = 1 : Y =0
Do While x < 3
X=x+1
Y=y + x
Text1.Text=x
Text2.Text=y
End Sub
2、 下面程序段执行后,在窗体上显示的结果是什么?
Dim b As Integer,k As Integer
Let b=1
For k=1 To 5
Let b=b*k
If b>=15 Then
Exit For
Else
Let k=k+1
End If
Next k
Print k,b
3、 对下面程序,单击窗体后,窗体上显示什么内容?
Private Sub Form_Click()
Dim x As Integer,y As Integer,z As Integer
X=1:y=2:z=3
Call sub1(x,x,z)
Call sub1(x,y,y)
End Sub
Private Sub sub1(x As Integer, y As Integer, z As Integer)
Dim I As Integer
X=3*z
Y=2*z
Z=x+y
Print x,y,z
End Sub
4、 下面程序段在窗体上输出的是什么?
Dim a(4,4) As Integer
Dim nc As Integer,nr As Integer
Dim I as Integer,j As Integer ,k As Integer
Nc=4:nr=1:I=1:j=1
For k=1 To 16
A(I,j)=k
If I<nc And j=nr Then
I=I+1
ElseIf I=nc And j<nc Then
J=j+1
ElseIf I>nr And j=nc Then
I=I-1
ElseIf I=nr And j>nr+1 Then
Nc=nc-1
Nr=nr+1
End If
Next
Print a(4,1),a(1,3),a(2,3)
后天就要交作业了,可是我不会 高手给说说吧