'' 求1+3+5+ + 99 = ?
'Public Class Form1
' Dim sumN = 0
' Sub sum(sN, eN, stepN)
' '判斷結束否
' If sN > eN Then Return
' '每次過程要做的事
' sumN = sumN + sN
' '往完成工作方向前進
' sum(sN + stepN, eN, stepN)
' End Sub
' Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' Call sum(1, 100, 2)
' MsgBox(sumN)
' End Sub
'End Class
' 求1!+2!+3!+ + 10! = ?
'Public Class Form1
' Dim sumN = 0
' Sub sum(sN, eN, stepN)
' '判斷結束否
' If sN > eN Then Return
' '每次過程要做的事
' Dim tsum = 1
' For i = 1 To sN
' tsum = tsum * i
' Next
' sumN = sumN + tsum
' '往完成工作方向前進
' sum(sN + stepN, eN, stepN)
' End Sub
' Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' Call sum(1, 5, 1)
' MsgBox(sumN)
' End Sub
'End Class
'尋找最大值
'Public Class Form1
' Dim maxValue = 0
' Dim a() = {10, 200, 100, 50, 30}
' Sub fMax(sN, eN)
' '判斷結束否
' If sN > eN Then Return
' '每次過程要做的事
' If a(sN) > maxValue Then maxValue = a(sN)
' '往完成工作方向前進
' fMax(sN + 1, eN)
' End Sub
' Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' Call fMax(0, a.Length - 1)
' MsgBox(maxValue)
' End Sub
'End Class
標籤雲
visual basic 2008
(157)
訊息分享
(111)
Visual Studio 2008
(64)
wpf
(37)
每日一句
(35)
cpp
(30)
python
(26)
Silverlight
(22)
C++
(18)
Network Security
(15)
全國技藝競竇
(14)
好文分享
(11)
.Net
(10)
Blogger
(10)
名詞解釋
(10)
研討會
(10)
Excel
(9)
書籍介紹
(9)
每日一小品
(9)
電腦黑白講
(8)
Visual Studio 201X
(7)
分享
(7)
網頁設計
(7)
CSS
(5)
Algorithm
(4)
Network
(3)
PHP
(3)
Access
(2)
SA
(2)
VB.Net
(2)
VBA
(2)
WireShark
(2)
Word
(2)
php html
(2)
其他好東東
(2)
分類整理
(2)
Asp.Net
(1)
Batch
(1)
Blockly
(1)
IT News
(1)
OpenAI
(1)
SE
(1)
W7
(1)
Writer
(1)
app inv2
(1)
dfs
(1)
vex vr sample
(1)
影像處理練習
(1)
黑白講
(1)
2014年4月22日 星期二
Resurive Sample
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言