VB数组排序的问题?
比如有一组数1,1,2,3,5,8,13……规律就是第3个数等于前2个数之和,写个程序,求第N个是什么数?
Option Explicit Dim AAAA() As Double Private Sub Command1_Click() Dim Number As Double, Total As Double, i As Double Number = (InputBox("Number?")) ReDim AAAA(Number) For i = 0 To Number AAAA(i) = 0 Next i AAAA(0) = 1: AAAA(1) = 1 For i = 2 To Number Total = AAAA(i - 1) + AAAA(i - 2) AAAA(i) = Total Next i MsgBox Total End Sub