填空题 执行下面的程序后,单击按钮Command1,则N的值是 1,A的值是 2,B的值是 3
Option Explicit
Dim n As Integer
Private Sub Command1_Click()
Dim a As Integer, b As Integer
a=2:b=3
For n=1 To 6
If n Mod 2=0 Then
b=fun(n, a)+a
Else
a=fun(b, n)+b
End If
Next n
Print n, a, b
End Sub
Private Function fun(x As Integer, y As Integer)As Integer
x=y-1+n
y=x+y-n
fun=x+y
End Function
【正确答案】
【答案解析】10 27 9