杨辉三角如何用VB语言表示
问题描述:
杨辉三角如何用VB语言表示
简单点
答
来个短一点的,
Private Sub Form_click()
Cls
Dim a() As Single
n = Val(InputBox("请输入行数","杨辉三角",5))
ReDim a(n + 1,n + 1)
For i = 1 To n
For j = 1 To i
a(i,1) = 1
a(i,i) = 1
a(i + 1,j + 1) = a(i,j) + a(i,j + 1)
Print a(i,j);
Next j
Print
Next i
End Sub