[.NET] 費氏數列的問題Orz

看板Visual_Basic作者 (希當普利斯)時間15年前 (2010/03/22 21:24), 編輯推噓0(003)
留言3則, 2人參與, 最新討論串1/1
請輸入專案類型(網站專案或者應用程式專案):應用程式專案 我照著之前版上那篇費氏數列的程式碼做了一次 但是每次都lebal1.text都只顯示一個數字,沒有辦法生出1、1、2… 這樣的排列 請問是哪邊錯了 Orz Function fib(ByVal x As Integer) If x = 0 Or x = 1 Then Return 1 Else Return fib(x - 1) + fib(x - 2) End If End Function Private Sub Form1_Load (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim i As Integer Dim j As Integer = 5000 For i = 0 To j Label1.Text = fib(i) & "、" 'If f(i) > 9527 Then 'Exit For 'End If Next End Sub 版本是 Visual Basic 2008 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.40.128.208

03/22 21:25, , 1F
if那邊我關掉了,因為還用不到@@
03/22 21:25, 1F
satou20444:轉錄至看板 ask 03/22 22:13

03/22 22:45, , 2F
Label1.Text &= fib(i) & "、"
03/22 22:45, 2F

03/22 22:56, , 3F
收到,終於鬼打牆結束了-.-
03/22 22:56, 3F
文章代碼(AID): #1Bfs-T13 (Visual_Basic)