Private Sub Form_Click()
Dim d(100000), i As Long
d(0) = 0
d(1) = 1
For i = 2 To 20
d(i) = d(i - 1) + d(i - 2)
Next i
For i = 0 To 20
Print d(i) And Space(5)
If i Mod 5 = 0 Then Print
Next i
Print "奇数"
For i = 0 To 20
If d(i) Mod 2 = 0 Then
Print d(i);
Next i
End Sub
这个哪错了
重新给你做了一个
Private Sub Command1_Click()
Dim fibo(1 To 20) As Long, i As Integer
Dim n As Integer, s As Long
fibo(1) = 0
fibo(2) = 1
n = 0
For i = 3 To 20
fibo(i) = fibo(i - 2) + fibo(i - 1)
Next i
For i = 1 To 20
Print fibo(i);
n = n + 1
If n = 5 Then n = 0: Print
Next i
For i = 1 To 20 Step 2
s = s + fibo(i)
Next i
Print s
End Sub