用VB編寫楊輝三角?
Option Base 1
Private Sub form_click()
Const n=10
Dim arr(n,n)As Integer
For i=1 To n
arr(i,i)=1
arr(i,1)=1
Next i
For i=3 To n
For j=2 To i-1
arr(i,j)=arr(i-1,j-1)+arr(i-1,j)
Next j
Next i
For i=1 To n
For j=1 To i
Print arr(i,j);
Next j
Next i
End Sub