程序代码:
Private Sub Command1_Click()
Dim a()
n = 10 'Val(Text1.Text)
Me.Cls
ReDim a(n + 1, n + 1)
For i = 1 To n
For j = 0 To i
a(1, i) = 1
a(i, i) = 1
a(i + 1, j + 1) = a(i, j) + a(i, j + 1)
Print a(i, j);
Next j
Next i
End Sub
学习总结:
算法的五大特性:
1、有穷性
2、确定性
3、可行性
4、输入
5、输出