也就是说用有关数组的知识编写如下图形:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
1 8 28 56 70 56 28 8 1
1 9 36 84 126 126 84 36 9 1
參考答案:Private Sub Form_Click()
Const N = 10
Dim a(N, N) As Integer
Dim i, j As Integer
a(0, 0) = 1
a(1, 0) = 1
a(1, 1) = 1
For i = 2 To N - 1
a(i, 0) = 1
a(i, i) = 1
For j = 1 To i - 1
a(i, j) = a(i - 1, j - 1) + a(i - 1, j)
Next j, i
For i = 0 To N - 1
For j = 0 To i
Print a(i, j);
Next j
Next i
End Sub