作业帮 > 数学 > 作业

VB 已知一个数列的前三项为0,0,1,以后各项都是其相邻前三项的的和,求该数列前36项

来源:学生作业帮 编辑:神马作文网作业帮 分类:数学作业 时间:2024/11/11 22:26:16
VB 已知一个数列的前三项为0,0,1,以后各项都是其相邻前三项的的和,求该数列前36项
RT
VB 已知一个数列的前三项为0,0,1,以后各项都是其相邻前三项的的和,求该数列前36项
Dim a(35) As Long
Dim i As Integer = 0,j As Integer = 0
For i = 0 To 35
a(i) = Nothing '''''''''''''''''''''''''''初始化
Next
a(0) = 0
a(1) = 0
a(2) = 1
For i = 3 To 35
a(i) = a(i - 1) + a(i - 2) + a(i - 3)
Next