推荐于2016-04-07
展开全部
先把form的autoredraw属性改成true,代码如下:
==========================
Option Explicit
Dim a(10, 10) As Long
Dim b(10) As String
Dim i As Byte
Dim j As Byte
Private Sub Form_Load()
a(0, 0) = 1
For i = 1 To 9
For j = 1 To 9
a(i, j) = a(i - 1, j - 1) + a(i - 1, j)
If a(i, j) <> 0 Then
b(j) = b(j - 1) & " " & a(i, j)
End If
Next
Print b(i)
Next
End Sub
==========================
Option Explicit
Dim a(10, 10) As Long
Dim b(10) As String
Dim i As Byte
Dim j As Byte
Private Sub Form_Load()
a(0, 0) = 1
For i = 1 To 9
For j = 1 To 9
a(i, j) = a(i - 1, j - 1) + a(i - 1, j)
If a(i, j) <> 0 Then
b(j) = b(j - 1) & " " & a(i, j)
End If
Next
Print b(i)
Next
End Sub
展开全部
Private Sub Form_Load()
Dim m(15)
Dim im(90)
Debug.Print "Yang-Hui San Jiao Xing"
n = 9
jj = 0
For i = 1 To n
For l = 1 To n
m(l) = 0
Next l
k = 1:
m(1) = 1
l = i + 1
For j = 1 To l
k = k * (i - j + 1) / j
m(j + 1) = k
Next j
For ij = 1 To l
ji = jj + ij
im(ji) = m(ij)
Next ij
jj = jj + l
Next i
j = 1
For i = 1 To n
For k = 1 To i + 1
Debug.Print Tab(30 - i * 3 + k * 6); im(j);
j = j + 1
Next k
Debug.Print
Next i
End Sub
Dim m(15)
Dim im(90)
Debug.Print "Yang-Hui San Jiao Xing"
n = 9
jj = 0
For i = 1 To n
For l = 1 To n
m(l) = 0
Next l
k = 1:
m(1) = 1
l = i + 1
For j = 1 To l
k = k * (i - j + 1) / j
m(j + 1) = k
Next j
For ij = 1 To l
ji = jj + ij
im(ji) = m(ij)
Next ij
jj = jj + l
Next i
j = 1
For i = 1 To n
For k = 1 To i + 1
Debug.Print Tab(30 - i * 3 + k * 6); im(j);
j = j + 1
Next k
Debug.Print
Next i
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
二楼的代码对,完成的很简洁,漂亮!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2006-05-13
展开全部
不错!!!!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
没错,收藏一下,投二楼一票
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询