来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/11 00:00:48
杨辉三角如何用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 Su