2014-05-15
VB中,怎样把杨辉三角形显示在图片框中
Option Explicit
Dim n As Integer, i As Integer, j As Integer, a() As Integer
Private Sub Command1_Click()
'判断输入的行数是否为数字
If IsNumeric(Text1。 Text) Then
n = Val(Text1。Text)
Else
MsgBox "您输入的不是数字"
Text1。SetFocus
End If
'重新定义数组并利用两次循环给数组赋值
ReDim a(n, n) As Integer
For i = 1 To n
a(i, 1) = 1: a(i, i) ...全部
Option Explicit
Dim n As Integer, i As Integer, j As Integer, a() As Integer
Private Sub Command1_Click()
'判断输入的行数是否为数字
If IsNumeric(Text1。
Text) Then
n = Val(Text1。Text)
Else
MsgBox "您输入的不是数字"
Tex