VB类似杨辉三角形编程
989
789
6789
56789
456789
3456789
23456789
123456789
989
789
6789
56789
456789
3456789
23456789
123456789
答案:Private Sub Command1_Click()
Dim a As Integer
a = 5'或6
Text1.Text = getdata(a)
End Sub
Private Function getdata(index As Integer) As Integer
Dim m, n As Integer
m = 1
n = 1
If index < 2 Then
getdata = 1
Exit Function
End If
For i = 2 To index
temp = n
n = m n
m = temp
Next
getdata = n
End Function