Dim num(100) As Long Private Sub Form_Load() Me.Hide Open App.Path & "\out.txt" For Output As #1 num(1) = 1: num(2) = 2 For i = 3 To 45 num(i) = num(i - 1) + num(i - 2) Next Print #1, num(45) Close #1 End End Sub
Dim s(45) As Long Private Sub Form_Load() Me.Hide Open App.Path & "\out.txt" For Output As #2 s(0) = 1 s(1) = 1 i = 2 For i = 2 To 45 s(i) = s(i - 1) + s(i - 2) Next Print #2, "第" & i - 1 & "項 " & s(i - 1) Close #2 End End Sub
Dim s(45) As Long Private Sub Form_Load() Me.Hide Open App.Path & "\out.txt" For Output As #1 s(1) = 1: s(2) = 2 For i = 3 To 45 s(i) = s(i - 1) + s(i - 2) Next Print #1, "第45項" & s(45) Close #1 End End Sub
Dim num(100) As Long
回覆刪除Private Sub Form_Load()
Me.Hide
Open App.Path & "\out.txt" For Output As #1
num(1) = 1: num(2) = 2
For i = 3 To 45
num(i) = num(i - 1) + num(i - 2)
Next
Print #1, num(45)
Close #1
End
End Sub
Dim s(45) As Long
回覆刪除Private Sub Form_Load()
Me.Hide
Open App.Path & "\out.txt" For Output As #2
s(0) = 1
s(1) = 1
i = 2
For i = 2 To 45
s(i) = s(i - 1) + s(i - 2)
Next
Print #2, "第" & i - 1 & "項 " & s(i - 1)
Close #2
End
End Sub
Dim s(45) As Long
回覆刪除Private Sub Form_Load()
Me.Hide
Open App.Path & "\out.txt" For Output As #1
s(1) = 1: s(2) = 2
For i = 3 To 45
s(i) = s(i - 1) + s(i - 2)
Next
Print #1, "第45項" & s(45)
Close #1
End
End Sub