在窗体上输出左下角为直角的杨辉三角 Private Sub Form_Load() Dim a, i%, j%, n% Show n = Val(InputBox("n=", "input", 0)) ReDim ( ) For i = 1 To n a(i, 1) = 1:( ) = 1 Next For i = ( ) To n For j = ( ) To i - 1 a(i, j) = ( ) + a(i - 1, j) Next j, i For i = 1 To n For j = 1 To i Print Format(a(i, j), "@@@@"); Next j Print Next i End Sub 运行时 n 值给 9 ,结果如下图: