vb.net空心三角形 空心三角形java( 二 )


Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim n As Integer, i As Integer, j As Integer, a(,) As Integer
n = 10
ReDim a(n + 1, n + 1)
For i = 1 To n + 1
a(i, 1) = 1 : a(i, i) = 1 : Next i
For i = 3 To n + 1
For j = 2 To i - 1
a(i, j) = a(i - 1, j - 1) + a(i - 1, j)
Next j, i
For i = 1 To n + 1
For j = 1 To i
TextBox1.AppendText(Space(4 - Len(Trim(Str(a(i, j)))))Trim(Str(a(i, j))))
Next j
TextBox1.AppendText(vbCrLf)
Next i
End Sub
End Class
关于vb.net空心三角形和空心三角形java的介绍到此就结束了 , 不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。

推荐阅读