在窗体上输出 等腰三角形的杨辉三角 Private Sub Form_Load() Dim a, i%, j%, n% Show Cls n = Val(InputBox("n=", "input", 0)) ReDim ( ) For i = 1 To n a(i, n + 1 - i) = ( ) a(i, n - 1 + i) = 1 Next For i = 3 To n For j = 3 To 2 * n - 2 a(i, j) = ( ) + ( ) Next j, i For i = 1 To n For j = 1 To ( ) If a(i, j) = 0 Then Print Spc(5); Else Print Format(a(i, j), "!@@@@@"); End If Next j Print Next i End Sub 运行时 n 值给 9 ,结果如下图: