下列程式執行後,value得值為何?
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim value As Integer
value = fibonacci(10)
MsgBox(value)
End Sub
Private Function fibonacci(ByVal n) As Integer
If n = 0 Then
fibonacci = 0
ElseIf n = 1 Then
fibonacci = 1
Else
fibonacci = fibonacci(n - 1) + fibonacci(n - 2)
End If
End Function
End Class
==========
麻煩給我詳解謝謝!
更新1:
補上選項 (A)21 (B)34 (C)55 (D)89